RENAME VARIABLE

Answered

Hi:

I'm writing my own code inspection plugin. I'm having some trouble with rename. I could have it renamed as I specified, but now I want the user to be able to choose or type in the modified name, what should I do?

4 comments
Comment actions Permalink

Could you please clarify what you want to build exactly? Maybe a screenshot?

0
Comment actions Permalink

My plugin inspects whether variables comply with lowercamelcase format. 

The quickfix for this inspection,I use com.intellij.refactoring.rename.RenamePsiElementProcessor#renameElement to modify it. but now, I can only rename these incorrectly named variables and these references by changing the  initial to lowercase。

In idea,user can use shift+F6 to rename the variables,not only will it provide other options for modification, but the user will be able to re-spell them themselves.just like in this screenshot.I would like to know what api to use to achieve this effect.

Thank you!

0
Comment actions Permalink

This is provided by corresponding com.intellij.refactoring.rename.RenameHandler, by default com.intellij.refactoring.rename.PsiElementRenameHandler

0
Comment actions Permalink

Thank you for your reply! I have solved the problem successfully!

0

Please sign in to leave a comment.