-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
getScriptInfoOrConfig: Canonicalize tsconfig path before lookup #26280
Conversation
af2dfe9
to
a06fcb7
Compare
The error in travis has no stacktrace and doesn't occur when I run the test myself... |
a06fcb7
to
77494d6
Compare
Ran |
src/server/editorServices.ts
Outdated
@@ -1804,7 +1804,7 @@ namespace ts.server { | |||
const path = toNormalizedPath(uncheckedFileName); | |||
const info = this.getScriptInfoForNormalizedPath(path); | |||
if (info) return info; | |||
const configProject = this.configuredProjects.get(uncheckedFileName); | |||
const configProject = this.configuredProjects.get(this.toCanonicalFileName(uncheckedFileName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is right infact you want to use 'path' here as the key I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like I still at least need this.toCanonicalFileName(path)
. The key comes from project.canonicalConfigPath
which is asNormalizedPath(projectService.toCanonicalFileName(configFileName));
@RyanCavanaugh Any guess what might be going on here? The error is |
src/server/editorServices.ts
Outdated
@@ -1884,7 +1884,7 @@ namespace ts.server { | |||
const path = toNormalizedPath(uncheckedFileName); | |||
const info = this.getScriptInfoForNormalizedPath(path); | |||
if (info) return info; | |||
const configProject = this.configuredProjects.get(uncheckedFileName); | |||
const configProject = this.configuredProjects.get(this.toCanonicalFileName(path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should this.toPath(uncheckedFileName)
instead of just canonicalizing file name, (you need to handle current directory as well though in most cases unchecked file is absolute path but toPath is more correct version)
May fix the remaining issue in #24857