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/#3258): Rescript identifiers not completing with opened module #3279

merged 6 commits into from Mar 16, 2021


Copy link

@bryphe bryphe commented Mar 15, 2021

Issue: After opening a module (ie, open Array), functions that are now exposed, like max wouldn't show up in completion.

Defect: When typing (ie, m|), the completion meet would be at position 0 - and querying the completions at position 0 for the rescript provider wouldn't return anything.

Fix: In the case where a token is at the beginning of a line, or after a space, query after the first character - this gives better results and mimics the behavior of Code. In addition, keep track of a separate insertLocation which built-in keywords and snippets can use to pick up the correct insertion range.

Fixes #3258

@bryphe bryphe merged commit 67d8029 into master Mar 16, 2021
@bryphe bryphe deleted the fix/completion/3258/rescript-autocomplete branch March 16, 2021 20:12
bryphe added a commit that referenced this pull request Mar 22, 2021
…ases (#3309)

__Issue:__ A combination of #3279 and #3298 caused a regression in keyword / snippet completion.

In some cases, the keyword completion would work fine - but if there was a non-word trigger character in front, that character would be consumed by the insertion.

__Defect:__ In #3279 , an `insertLocation` was added to the meet. This `insertLocation` is used for positioning the insertion. In #3298, the keywords/ snippets bake in an insert range - but from the `meet.location` instead of `meet.insertLocation`. The `meet.location` is incorrect in the situation described above, so it causes an incorrect insertion position.

__Fix:__ Pass `meet.insertLocation` to the snippet / keyword providers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Rescript autocomplete for identifiers not working
1 participant