How to trigger additional operations on code formatting (Ctrl+Alt+L)
Need to do additional code formatting operations (others than INDENT, WRAP and SPACING) when code formatting is triggered (like changing the case of the tokens). Unfortunately the FormattingDocumentModel is built also when Return is pressed, in which case I do not want the additional operations to be executed.
Is there a listener on the deliberate code formatting invocation (CtrlAltL)? Ideally it should provide the PsiElement which is being formatted.
请先登录再写评论。
Hello Dan,
No, there is no such listener.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi Dmitry,
Thanks for the feedback.
Is there another way to intercept an action invocation?
Dan
Dan Cioca wrote:
Usually in this situation the best thing is to implement and replace
with your own action which delegates to the existing one, and does
whatever you need around it.
N.
Thanks Nathan,
i would prefer a more non-intrusive solution but it looks like there is none.
Regards,
Dan