title |
---|
18. Quick Fix |
A quick fix allows to apply an automatic changes to the code via Show Intention Actions (Alt + Enter).
Let's add a quick fix which helps to define an unresolved property from its usage.
{% include /code_samples/simple_language_plugin/src/com/simpleplugin/psi/SimpleElementFactory.java %}
The quick fix will create a property in the file chosen by user, and navigate to this property after creation.
{% include /code_samples/simple_language_plugin/src/com/simpleplugin/CreatePropertyQuickFix.java %}
{% include /code_samples/simple_language_plugin/src/com/simpleplugin/SimpleAnnotator.java %}
Now let's try to use a property which is not defined yet.