Skip to content

Conversation

weswigham
Copy link
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
Member Author

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

export function noop(): void {}

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

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.

}
else {
const newBase = configFileName ? getDirectoryPath(toPath(configFileName, basePath, getCanonicalFileName)) : basePath;
const newBase = configFileName ? getDirectoryPath(toPath(configFileName, basePath, identity)) : basePath;
Copy link

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.

/** Does nothing. */
export function noop(): void {}

/** Passes thru argument. */
Copy link

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