GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ignore casing when converting a source file path to relative path by zhengbli · Pull Request #9213 · microsoft/TypeScript

Conversation

@zhengbli

@zhengbli Zhengbo Li (zhengbli) commented Jun 16, 2016

Copy link
Copy Markdown

Fixes #8837

When converting an absolute file name to a relative file name, sometimes the commonSourceDirectory and the absolute file name have different casing, which should be ignored.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zhengbli
ignore casing when converting a source file path to relative path
478d763
@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-not-required label Jun 16, 2016
sheetalkamat
sheetalkamat reviewed Jun 16, 2016
View reviewed changes
Comment thread src/compiler/utilities.ts Outdated
let sourceFilePath = getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory());
sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), "");
const commonSourceDirectory = host.getCommonSourceDirectory();
const isSourceFileInCommonSourceDirectory = sourceFilePath.toLowerCase().indexOf(commonSourceDirectory.toLowerCase()) === 0;

@sheetalkamat Sheetal Nandi (sheetalkamat) Jun 16, 2016

Copy link
Copy Markdown
Member

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 shouldn't be done without checking ignoreCase option in compilerOptions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@zhengbli Zhengbo Li (zhengbli) Jun 16, 2016

Copy link
Copy Markdown
Author

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 only found a forceConsistentCasingInFileNames option in the compilerOptions. Is that what you are referring to?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sheetalkamat Sheetal Nandi (sheetalkamat) Jun 17, 2016

Copy link
Copy Markdown
Member

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.

Meant usage of getCanonicalFileName instead to handle the casing option just like the way we do in relative name computation or common directory name compuation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@zhengbli Zhengbo Li (zhengbli) Jun 17, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

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.

The case sensitivity used by getCanonicalFileName is actually not very trustable, because we tell the file system case sensitivity solely by OS. However, in some cases this is wrong, for example network mounted file system on Windows, or HFS / HFS+ on OSX. Relying on it has caused many troubles previously when dealing with file watching. So I think it might be better if we only use the canonical file name internally for comparison purpose, but not when directly talking to the file system.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@zhengbli

Zhengbo Li (zhengbli) commented Jun 17, 2016

Copy link
Copy Markdown
Author

Mohamed Hegazy (@mhegazy) Vladimir Matveev (@vladima) can you take a look?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zhengbli
Use getCanonicalFileName
d9bd31f
@mhegazy

Mohamed Hegazy (mhegazy) commented Jun 20, 2016

Copy link
Copy Markdown
Contributor

👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zhengbli
Zhengbo Li (zhengbli) merged commit 7b3abc6 into microsoft:master Jun 20, 2016
@zhengbli
Zhengbo Li (zhengbli) deleted the fixRealPath branch June 20, 2016 21:07
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@zhengbli @mhegazy @sheetalkamat @msftclas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.