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(lsp): handle importmaps properly #11496

Merged
merged 5 commits into from
Jul 25, 2021
Merged

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Jul 23, 2021

This fixes several issues with import maps and the language server:

  • When the import map was updated, dependencies were not recalculated, meaning changes the open documents were required to "update" the files.
  • Non-open resources did not actually have import maps applied to them, which resulted in situations where types "corrected themselves" when opening documents in the editor.
  • Open documents in the editor didn't use the language ID, instead inferred the type from the module specifier, which is an imprecise way of determining the type of the file.

Fixes: #11146
Fixes: #11456
Fixes: #10439

@kitsonk kitsonk requested a review from bartlomieju July 23, 2021 22:40
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, nice fix

cli/lsp/tsc.rs Outdated Show resolved Hide resolved
@kitsonk kitsonk merged commit 72ac9c3 into denoland:main Jul 25, 2021
@kitsonk kitsonk deleted the lsp_fix_import_map branch July 25, 2021 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants