Skip to content

Explicitly avoid canonicalizing paths during configuration handling#18316

Merged
weswigham merged 2 commits into
microsoft:masterfrom
weswigham:do-not-canonicalize-paths
Sep 7, 2017
Merged

Explicitly avoid canonicalizing paths during configuration handling#18316
weswigham merged 2 commits into
microsoft:masterfrom
weswigham:do-not-canonicalize-paths

Conversation

@weswigham
Copy link
Copy Markdown
Member

According to this comment, forceConsistentCasingInFileNames relies on paths not being canonicalized until later in the process; so this replaces new usages of getCanonicalFileName in the configuration parser with an identity function, so as to avoid canonicalizing the path when it is not needed.

@weswigham weswigham requested a review from a user September 7, 2017 18:32
@weswigham
Copy link
Copy Markdown
Member Author

@Andy-MS Would you take a look at this?

Comment thread src/compiler/core.ts
export function noop(): void {}

/** Passes thru argument. */
export function identity<T>(x: T) { return x; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This could also replace identityMapper in checker.ts.

Comment thread src/compiler/commandLineParser.ts Outdated
}
else {
const newBase = configFileName ? getDirectoryPath(toPath(configFileName, basePath, getCanonicalFileName)) : basePath;
const newBase = configFileName ? getDirectoryPath(toPath(configFileName, basePath, identity)) : basePath;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Might want to create a local toPath function delegating to ts.toPath that explains why we use identity here.

Comment thread src/compiler/core.ts Outdated
/** Does nothing. */
export function noop(): void {}

/** Passes thru argument. */
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

through; or just Returns its argument.

@weswigham weswigham merged commit 27f9cdb into microsoft:master Sep 7, 2017
@weswigham weswigham deleted the do-not-canonicalize-paths branch September 7, 2017 22:54
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
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.

2 participants