Skip to content

Fixed Inconsistencies between Drive Paths on Windows (C:\ vs c:\)#245

Merged
felixfbecker merged 10 commits intoxdebug:masterfrom
johnrom:inconsistent-casing-2
Mar 14, 2018
Merged

Fixed Inconsistencies between Drive Paths on Windows (C:\ vs c:\)#245
felixfbecker merged 10 commits intoxdebug:masterfrom
johnrom:inconsistent-casing-2

Conversation

@johnrom
Copy link
Copy Markdown
Contributor

@johnrom johnrom commented Feb 23, 2018

It seems like VS Code or another dependency has begun using lowercase drive names in some places, but not in ${workspaceRoot}

This will make it match up.

@johnrom johnrom mentioned this pull request Feb 23, 2018
@felixfbecker
Copy link
Copy Markdown
Contributor

Build is failing

@felixfbecker
Copy link
Copy Markdown
Contributor

Referencing #239

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2018

Codecov Report

Merging #245 into master will increase coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #245      +/-   ##
=========================================
+ Coverage   69.48%   69.6%   +0.12%     
=========================================
  Files           5       5              
  Lines         983     987       +4     
  Branches      158     160       +2     
=========================================
+ Hits          683     687       +4     
  Misses        300     300
Impacted Files Coverage Δ
src/paths.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68adf04...f6b7779. Read the comment docs.

@johnrom
Copy link
Copy Markdown
Contributor Author

johnrom commented Feb 26, 2018

Builds fixed, ready for review

Comment thread src/paths.ts Outdated
let localSourceRoot: string | undefined
let serverSourceRoot: string | undefined
let localFileUri = fileUrl(localPath, { resolve: false })
let localFileUriLower = fileUrl(localPath.replace(/[a-zA-Z]:\\/, (match: any) => match.toLowerCase()), {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is match any? Shouldn't this be inferred as string?

Comment thread src/paths.ts Outdated
// resolve from the server source root
serverFileUri = url.resolve(serverSourceRootUrl, urlRelativeToSourceRoot)

// we lowercased the Url, maybe we should undo that
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment confuses me, what do you mean with maybe?

Comment thread src/paths.ts Outdated
resolve: false,
})
let serverFileUri: string
let uriWasLowerCased = false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Frankly I am confused why this fix requires this variable - shouldn't it be possible to just normalise everything to a canonical representation?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

E.g. before the path mapping feature I had this PR: #198
Can't the same be done, but for all paths in the map?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the purpose of the "maybe" in the comment above. I wanted to hand back the server URI with the casing that it was given, for consistency. But I wasn't sure it mattered either way (is there a case where a drive letter could be case sensitive? I don't know)

If you are saying there is no purpose for that, I'll remove it and we can be on our merry way. This issue is simply making using VSCode unbearable so getting it fixed is my top priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants