Is there a way to call a method which indent the selected code?

Answered

I am writing a plugin in which plugin will select the code and make changes to it but those changes are messing the actual indentation, I want indentation of the code should be correct.

Is there any API which I can call to fix the indentation?

0
1 comment

Hi,

Try using com.intellij.psi.codeStyle.CodeStyleManager#adjustLineIndent(com.intellij.psi.PsiFile, com.intellij.openapi.util.TextRange).

0

Please sign in to leave a comment.