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

perf(lsp): use null types instead of stub modules #21541

Merged

Conversation

nayeemrmn
Copy link
Collaborator

When tsc tries to load types for a module which had failed to resolve (labelled internal:///missing_dependency.d.ts), return null instead of a stub module like:

declare const __: any;
export = __;

#20780 fixed a discrepancy between deno check and LSP type-checking where that latter was returning null from op_load() instead of using the above stub module. After seeing denoland/vscode_deno#895 (comment) we suspect that this caused a slowdown in projects using node compat. So this PR flips them both the other way.

As far as we know this change only affects the behaviour of doing erroneous type imports from untyped modules. These will no longer error and there's no real reason they should.

@nayeemrmn nayeemrmn merged commit 7d88e48 into denoland:main Dec 12, 2023
@nayeemrmn nayeemrmn deleted the lsp-tsc-missing-dependency-undefined branch December 12, 2023 10:27
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