Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve completion AST node accuracy #1267

Merged
merged 3 commits into from
Nov 8, 2023
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Nov 5, 2023

Closes #1266

Improves the accuracy with which the completion provider picks the AST node:

  1. Fixes a very minor issue in the findLeafNodeAtOffset method, which sometimes gave back a CST node that appeared after the specified offset.
  2. 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.

@msujew msujew added the completion Completion related issue label Nov 5, 2023
Copy link
Contributor

@sailingKieler sailingKieler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm basically fine with theses changes, and I would happy if my remarks would somehow make it into the code 😉

@msujew msujew merged commit bc6dabe into main Nov 8, 2023
@msujew msujew deleted the msujew/fix-completion-node branch November 8, 2023 12:25
@spoenemann spoenemann added this to the v3.0.0 milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completion Completion related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent behavior in the completion provider service
3 participants