question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

resources#relativePath does not honour path casing strategy

See original GitHub issue

It seems to me that resources.relativePath ignores the fact that path casing should be ignored depending on the underlying file system. As you can see here:

https://github.com/microsoft/vscode/blob/6e022766d135689a6a5f92a4f3d9ebf97b238dd0/src/vs/base/common/resources.ts#L232-L235

Extracted from https://github.com/microsoft/vscode/issues/107774

I am actually no longer so sure that path casing is ignored, @jrieken is that handling for file URI intentional?

Only @aeschli knows, he wrote those utils and I didn’t change their semantics when moving them to IExtUri. But, yeah it seems that there is some scheme and platform specific handling in there and I don’t think that is good.

_Originally posted by @jrieken in https://github.com/microsoft/vscode/issues/107774#issuecomment-705017638_

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
bpaserocommented, Oct 16, 2020

Yes, we need to ensure the canonical URI is used unless people are using IURIIdentityService.extUri which is really what I was suggesting and actually prefer. Why would people bother with canonical URIs if you can just use IURIIDentityService.extUri. I really think no one should be producing canonical URIs, only in very specific places as we do today where we create text models or editors.

Anyone else should use IURIIdentityService.extUri when dealing with URIs and then this should not be an issue at all.

0reactions
aeschlicommented, Oct 16, 2020

@bpasero See https://github.com/microsoft/vscode/issues/108256#issuecomment-709436838: since a while resources.relativePath maps to extUri.relativePath which is case sensitive for all schemas/platforms. We never ran into any issues as for file schems we didn’t honor the path casing strategy (the topic of this issue), Now with my proposed fix (#108796), this is uncovered.

We must go through all usages of resources.relativePath and either a. change it to extUriBiasedIgnorePathCase.relativePath to get the old behavior b. Make sure that the URIs that are passed in are canonical uris

Also a possibility: c. we change resources.relativePath to extUriBiasedIgnorePathCase.relativePath. d. we alway ignore case for drive letters only (we already have code in relativePath to detect windows drive segments)

(b.) is the preferred solution, but requires some work, e.g. #108793

Read more comments on GitHub >

github_iconTop Results From Across the Web

open resource with relative path in Java - Stack Overflow
I was having issues loading my resources from the res directory. I wanted all my resources separate from my source code (simply for...
Read more >
Uploaded file resource: Relative links - Moodle.org
Everything was working fine but now I have a problem: The relative links within the uploaded html files (image links) are not properly...
Read more >
Beginners guide to serving files using HTTP servers in Go
Any relative file paths used in these files hold no meaning in runtime. os.Executable function. In most cases, we should try to use...
Read more >
Relative Paths to Project Resources | ReadyAPI Documentation
To solve this issue, use the Resource Root project property. If this property is specified, ReadyAPI uses relative paths starting from the specified...
Read more >
JAXB Users Guide - Java EE
Yet in some other cases, a schema may reference another schema in relative path, and that may not match your directory structure.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found