Skip to content

getScriptInfoOrConfig: Canonicalize tsconfig path before lookup#26280

Merged
sheetalkamat merged 10 commits intomasterfrom
tsconfig_canonicalpath
Jan 9, 2019
Merged

getScriptInfoOrConfig: Canonicalize tsconfig path before lookup#26280
sheetalkamat merged 10 commits intomasterfrom
tsconfig_canonicalpath

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Aug 7, 2018

May fix the remaining issue in #24857

@ghost ghost requested a review from sheetalkamat August 7, 2018 23:14
@ghost ghost force-pushed the tsconfig_canonicalpath branch from af2dfe9 to a06fcb7 Compare August 7, 2018 23:14
@ghost
Copy link
Copy Markdown
Author

ghost commented Aug 8, 2018

The error in travis has no stacktrace and doesn't occur when I run the test myself...

@ghost ghost force-pushed the tsconfig_canonicalpath branch from a06fcb7 to 77494d6 Compare August 9, 2018 15:20
@ghost
Copy link
Copy Markdown
Author

ghost commented Aug 9, 2018

Ran jake runtests (rather than jake runtests --t tsserverProjectSystem to avoid a situation like #10683) on windows and still see no errors locally.

Comment thread src/server/editorServices.ts Outdated
const info = this.getScriptInfoForNormalizedPath(path);
if (info) return info;
const configProject = this.configuredProjects.get(uncheckedFileName);
const configProject = this.configuredProjects.get(this.toCanonicalFileName(uncheckedFileName));
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Author

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));

@ghost
Copy link
Copy Markdown
Author

ghost commented Sep 17, 2018

@RyanCavanaugh Any guess what might be going on here? The error is TypeError: Cannot read property 'call' of undefined with no stack trace. Can't reproduce on windows or linux. Tested with jake runtests light=false t=tsserver.

Comment thread src/server/editorServices.ts Outdated
const info = this.getScriptInfoForNormalizedPath(path);
if (info) return info;
const configProject = this.configuredProjects.get(uncheckedFileName);
const configProject = this.configuredProjects.get(this.toCanonicalFileName(path));
Copy link
Copy Markdown
Member

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)

@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.2 milestone Sep 17, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants