Skip to content

fix(41736): tsserver should not crash if external file does not exist #41737

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

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

kyliau
Copy link
Contributor

@kyliau kyliau commented Nov 30, 2020

If a file does not exist, projectService.getOrCreateScriptInfoNotOpenedByClient()
will return undefined, but tsserver does not handle this case.

Fixes #41736

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 30, 2020
Copy link
Member

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

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

Change looks good but please add a test in configured project testRunner\unittests\tsserver\configuredProjects.ts .. Some of the tests that use plugin are
https://github.com/microsoft/TypeScript/blob/master/src/testRunner/unittests/tsserver/metadataInResponse.ts#L27
https://github.com/microsoft/TypeScript/blob/master/src/testRunner/unittests/tsserver/externalProjects.ts#L60

If a file does not exist, `projectService.getOrCreateScriptInfoNotOpenedByClient()`
will return `undefined`, but tsserver does not handle this case.

Fix microsoft#41736
@kyliau
Copy link
Contributor Author

kyliau commented Nov 30, 2020

Change looks good but please add a test in configured project testRunner\unittests\tsserver\configuredProjects.ts .. Some of the tests that use plugin are
https://github.com/microsoft/TypeScript/blob/master/src/testRunner/unittests/tsserver/metadataInResponse.ts#L27
https://github.com/microsoft/TypeScript/blob/master/src/testRunner/unittests/tsserver/externalProjects.ts#L60

@sheetalkamat thank you very much for the pointer! I've added a test for external file 😄

@sheetalkamat sheetalkamat merged commit cf4df4e into microsoft:master Dec 1, 2020
@kyliau kyliau deleted the external-files branch December 1, 2020 00:39
kyliau added a commit to kyliau/angular that referenced this pull request Dec 2, 2020
…exist

There is a bug in tsserver that causes it to crash when it tries to create
script info for an external template that does not exist.

I've submitted an upstream PR
microsoft/TypeScript#41737 to fix this, but before
the commit lands in the stable release, we'll have to workaround the issue
in language service.

Close angular/vscode-ng-language-service#1001
mhevery pushed a commit to angular/angular that referenced this pull request Dec 3, 2020
…exist (#39898)

There is a bug in tsserver that causes it to crash when it tries to create
script info for an external template that does not exist.

I've submitted an upstream PR
microsoft/TypeScript#41737 to fix this, but before
the commit lands in the stable release, we'll have to workaround the issue
in language service.

Close angular/vscode-ng-language-service#1001

PR Close #39898
mhevery pushed a commit to angular/angular that referenced this pull request Dec 3, 2020
…exist (#39898)

There is a bug in tsserver that causes it to crash when it tries to create
script info for an external template that does not exist.

I've submitted an upstream PR
microsoft/TypeScript#41737 to fix this, but before
the commit lands in the stable release, we'll have to workaround the issue
in language service.

Close angular/vscode-ng-language-service#1001

PR Close #39898
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

script info for external project could be undefined
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy