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

Fix completion on first character #909

Merged
merged 3 commits into from
Apr 4, 2022

Conversation

tboby
Copy link
Contributor

@tboby tboby commented Apr 4, 2022

This fixes completion on the first character (or no characters) of a new expression. This substantially improves the suggestions workflow in VS Code.

This is done by adding another lookup kind for the Lexer which doesn't allow too many tokens from the left to get picked up. This prevents an operator or whitespace being picked as the current token which breaks later parts of the completion logic.

Code_akGSS5ANOL

This is still a workaround, as I still don't fully understand the whole TryGetCompletions process. It doesn't fix completion everywhere either. For example, after the < of a type param. However, < isn't a trigger character so it isn't as much of a problem.

tboby added 3 commits April 4, 2022 17:26
- Add custom handling for the lexer when being used for completion
@baronfel
Copy link
Contributor

baronfel commented Apr 4, 2022

This is great! Thank you for adding tests. I'm happy to see that you found a less-impactful change than copying the entire longIdent-finding function like we were talking about :)

I'm very happy to take this change pending green tests, and we can look into any more comprehensive work building off of your tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants