PsiAwareTextEditorProvider.createEditor is never invoked in 2023.2.5?
已回答
My plugin has a custom editor implementation and in my editor provider class it overrides the createEditor
method. However, after upgrading to 2023.2.5 it is never invoked, and when I run the plugin in the debugger, I see that the PsiAwareTextEditorProvider.createEditor
is also never invoked, instead it invokes createEditorBuilder
. Is it a bug or am I supposed to override this method from now on?
请先登录再写评论。
I implemented the
createEditorBuilder
method and now the plugin works with 2023.2.5 but fails to compile with 2023.1.5 (obviously) so I'm wondering if the backwards-compatibility here is broken or there are ways around it.Hi Eugene,
I can see usages of
createEditor
, so it's hard to say why it is not called in your case. If implementingcreateEditorBuilder
fixes the issue for 2023.2.5, then it seems to be a proper fix. In case the API change is not backward compatible, then the solution is to release multiple plugin versions with the proper since-build/until-build values in plugin.xml.Please note that
PsiAwareTextEditorProvider
is not part of the open API, and its compatibility with the older versions is not guaranteed.Hmm, sorry, I have to reopen this issue - after upgrading to 2024.2.1 the
createEditorBuilder()
is not called either, and as a result, my custom editor is not created. What is the proper/recommended way to implement a custom editor feature? What I have in my plugin is:<fileEditorProvider implementation="io.portx.datasonnet.editor.DataSonnetEditorProvider"/>
in my
plugin.xml
;class
DataSonnetEditorProvider
which extendsPsiAwareTextEditorProvider
and implementsaccept()
andcreateEditor()
methods.There is a method
createFileEditor()
in parent class, but for some reason I cannot override it, the error I'm getting is that it has the same erasure.I managed to override
createFileEditor()
but I'm getting the errorAccess is allowed from Event Dispatch Thread (EDT) only
when instantiating my editor inside the method - which does make sense - but how do I make sure this is invoked on EDT thread? Not sure if I can useinvokeLater()
because it does not return the value.