Detect if code reformatting was explicitely called by user or automatically

hello, I am trying to make the plugin use an external code formatter implementing FormattingModelBuilder and calling it from createModel(). It works fine when the user selects 'Reformat code (Command + Option+ L, Ctrl + Alt + L)'. The problem is that code is also called when editing the file was well, e.g. when adding new lines. Is there a way to know if the call to createModel was by select that menu or automatically?

0
1 comment

Hi Jhonny,

You can check current command name in order to see if explicit reformat/adjust line action is being processed - CommangeProcessor.getInstance().getCurrentComandName()

Denis

0

Please sign in to leave a comment.