Custom keyword auto-completion plugin

Hi there!

I am looking to write the plugin that triggers dropdown upon a certain keyword match in the editor (for java language), and works very much like standard code auto-completion, except editor would need to recognize custom keywords.

Say, user types

CUSTOMBLAH.

At this point, dropdown should be poulated with available values, which can also cascade to the next level (CUSTOMBLAH.BAR.FOO) etc..

When users reaches the final level, typed value would expand to the custom code snippet.

Is this possible to do with Open API? If so, which APIs should I be looking at?

Thanks

-elena

5 comments

Have you looked at the com.intellij.codeInsight.completion.CompletionData class ?

That should work for you.

0

Yes, I have... However, it did not seem that com.intellij.codeInsight.completion was a part of an Open API... Do you know if this package is blessed for external use?

Thanks for your help,
-elena

0

Yes, that's right, it's not OpenAPI but quite some people use it with success. Just search this forum and you'll find some starting points, or feel free to ask more specific questions here.

0

Hi,

I'm looking for the same thing. Can you please share your code.

thanks,
Shmulik

0

Please sign in to leave a comment.