Improves the accuracy with which the completion provider picks the AST node:
Fixes a very minor issue in the findLeafNodeAtOffset method, which sometimes gave back a CST node that appeared after the specified offset.
Only pick one AST node, ideally at the position before the current completion position.
Also reduces the amount of false-positive completion proposals by implementing a performNextTokenCompletion method. In cases where we definitely first want to complete the current ID/word/keyword/etc, the completion provider should not yield more completion contexts. This method controls that behavior by checking whether we have a word at the current offset position.
Closes https://github.com/eclipse-langium/langium/issues/1266
Improves the accuracy with which the completion provider picks the AST node:
findLeafNodeAtOffset
method, which sometimes gave back a CST node that appeared after the specified offset.Also reduces the amount of false-positive completion proposals by implementing a
performNextTokenCompletion
method. In cases where we definitely first want to complete the current ID/word/keyword/etc, the completion provider should not yield more completion contexts. This method controls that behavior by checking whether we have a word at the current offset position.