Skip to content

fix(language-core): handle empty mappings in updateVirtualCodeMapOfMap#161

Merged
johnsoncodehk merged 1 commit intomasterfrom
fix-ts-plugin-completions-empty-mappings
Apr 7, 2024
Merged

fix(language-core): handle empty mappings in updateVirtualCodeMapOfMap#161
johnsoncodehk merged 1 commit intomasterfrom
fix-ts-plugin-completions-empty-mappings

Conversation

@remcohaszing
Copy link
Member

If virtual code has no mappings, we still need to update virtual code maps based on a source of undefined. Without this, the TypeScript plugin isn’t able to find virtual code without mappings. For completions this means it falls back to TypeScript’s own getCompletsionsAtPosition implementation, which returns a list of everything in scope.

Refs mdx-js/mdx-analyzer#427

If virtual code has no mappings, we still need to update virtual code
maps based on a source of undefined. Without this, the TypeScript plugin
isn’t able to find virtual code without mappings. For completions this
means it falls back to TypeScript’s own `getCompletsionsAtPosition`
implementation, which returns a list of everything in scope.

Refs mdx-js/mdx-analyzer#427
@johnsoncodehk johnsoncodehk merged commit 42087b2 into master Apr 7, 2024
@johnsoncodehk johnsoncodehk deleted the fix-ts-plugin-completions-empty-mappings branch April 7, 2024 13:07
@johnsoncodehk
Copy link
Member

Thanks!

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