Idea Live Template to Log Method Args

前端 未结 3 995
Happy的楠姐
Happy的楠姐 2021-02-14 23:55

I would like to be able to create a live template in Jetbrain\'s Idea that will log the method\'s arguments. Let\'s call it \"larg\". It would work like:

public          


        
3条回答
  •  不要未来只要你来
    2021-02-15 00:47

    I'm 4 years late, but the predefined template soutp pretty much does this using a groovyscript variable.

    Here's the groovy script that does what you're looking for

    groovyScript("'\"' + _1.collect { it + ' = [\" + ' + it + ' + \"]'}.join(', ') + '\"'", methodParameters())
    

提交回复
热议问题