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

已回答

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

Hi,

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

0

请先登录再写评论。