Can I overwirte extensionPoints define in IdeaPlugin.xml Follow
I find this extensions in IdeaPlugin.xml
<codeInsight.createFieldFromUsageHelper language="JAVA" implementationClass="com.intellij.codeInsight.daemon.impl.quickfix.JavaCreateFieldFromUsageHelper"/>
so I overwirte it in my plugin.xml,like this
<codeInsight.createFieldFromUsageHelper language="JAVA" implementationClass="MyTestJavaCreateFieldFromUsageHelper"/>
but it did work.so my question is it impossible or I missed something?
Please sign in to leave a comment.
It's possible to make IDE use your language extension instead of default one by adding order="first" attribute to its xml tag. However it's risky, when something changes in the standard implementation these changes will be ignored if your plugin is installed. Why do you need to override the default implementation? Maybe we can provide a proper API for your needs?
Thank you for your response.
In my team there is several class whitch contailns some constants may change by others,so we difine then by a web page,and then with a tool to gen java class.I did't like web page,I want do these with idea.
these class may look like this or some enum:
Could you please describe that exactly do you want to do with the plugin? Do you want to generate a Java class from scratch? Or you want to add a field to an existing class?
Anyway, you don't need to override createFieldFromUsageHelper extension, it's about a general way to create a field by reference to it and you'll break this behavior if you override it.
sorry,what I exactly want to do is when there is undefine filed error add this field and some other info to mysql(and leave the other things to our tools).so now what bother me is how get to know when this error and how to get the element (a expression includes parent class and the undefine field).
You can provide implementation of com.intellij.codeInsight.quickfix.UnresolvedReferenceQuickFixProvider extension for PsiJavaCodeReferenceElement to do that.
can you give me more detail ?where can I config these impelement?
UnresolvedReferenceQuickFixProvider is an extension point, so you should register your implementation in plugin.xml file like you did for createFieldFromUsageHelper, I've added javadoc about it.