Autocompletion for sentences with validation error #1623
-
I am wondering if I have grammar error at other lines, how to show the autocompletion as usual for current line? Background.
Question:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 14 replies
-
Hey @durianwaffle,
I'm not entirely sure what you mean by that.
Does that happen when using the default completion provider or in your own implementation?
Assuming the error recovery works as expected, syntax errors in other lines of the file should not influence completion. However, if the error is unrecoverable, that might lead to issues. You can probably override the
In order to use markdown in the documentation, you need to use the langium/packages/langium/src/lsp/completion/completion-provider.ts Lines 478 to 487 in b2c40e3 Note that in general, completion is probably the most complicated (from a code/logic perspective) feature in Langium. It's incredibly hard to get it right for all situtations. |
Beta Was this translation helpful? Give feedback.
Hey @durianwaffle,
I'm not entirely sure what you mean by that.
getCompletion
is the entry point into the completion algorithm - since we only get the parameters from the language client, it's all that we have to perform the completion.completionFor
is way deeper into the algorithm, at a point where we've already identified what our next grammar element will be - both of these methods serve entirely different purposes.Does that happen when using the default completion provider or in your own implementation?