I want to prefix the parameter name when implementing a method

已回答

TIn my company, there is a convention to attach "_" to the parameter name of the method of the implementation class.

In "Code Generation" under "Settings> Editor> Code Style> java", "_" is set in Parameter Prefix.
However, implementing interface methods does not take effect.

The interface is as follows.

void sample (String str, int val);

Executing "Code> Implement Methods ..." to implement this will result in the following.

@Override
public void sample (String str, int val) {

}

I would like to be as follows.

@Override
public void sample(String _str, int _val) {

}

It is troublesome to fix the parameter name all the time.
Can I solve this problem with settings?

My environment is as follows.
   IntelliJ IDEA 2018.1.4 (Ultimate Edition)
   Build # IU-181.5087.20, built on May 17, 2018
   Windows 10 Pro.

0

Hello,

 

We have related request on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-82120

Feel free to vote for it and leave suggestions in comments.

0

Thanks for the response.
I commented on the ticket.

0

请先登录再写评论。