Adding extra symbols to Java auto complete
Hello,
Immediate problem
Can I get JAVA symbols in the autocomplete drop down box, that are not indexed as part of project creation? If so how?
Actual Problem
I want to load certain class files only when they are used (I plan to do this using a PsiTreeChangeListener and a custom vfs) in my plugin. I would like intellij to offer autocomplete suggestions even before the PsiTree is built for them. I want to provide autocompletion for these classes from some pre-computed data store.
Is this possible?
thanks
Siddharth
Please sign in to leave a comment.
Yes. Using the CompletionContributor API, you can add any completion variants in any context.
Thanks.
Next questions are
A pattern specifies the context in which your completion contributor is triggered.
The IntelliJ IDEA API doesn't care where you get your completion variants from; it's entirely up to you.
You can specify an InsertHandler for an item provided by your completion contributor; it's a callback that gets called when an item is selected. You can use it to add import statements or perform any other modifications of the document.