Inspecting code completion for syntax errors

Answered

Hi!

I'm currently working in a custom Java code completion plug-in that works with an API to process the context and return suggestions.

In most cases, the API is capable of making very good predictions. But, unfortunately, it doesn't always happen. Often, the suggestions contain errors, such as an unassigned variable or a class method that does not exist.

That said, I would like to know what can be explored to inspect the prediction for syntax errors and omit the completion when specific errors are detected.

The code is available here

Thanks ;)

1 comment
Comment actions Permalink

I'm not sure I understand your question. Do you want to inspect the _possible result_ for each completion variant shown, _if_ it was inserted at the current invocation? That seems quite tricky. Also, inserting completion variant can trigger all sorts of additional steps/code modifications or even show additional UI - other than just inserting the current completion text shown in lookup.

0

Please sign in to leave a comment.