Improves support to Windows UNC files in a "yet-to-be-saved" state#52518
Conversation
6aa9123 to
1bacd74
Compare
|
I am not very keen on changing the fsPath-semantics for the URI type because that is used a lot and worst, values of |
|
@jrieken I completely understand your concern, and that was not my initial attempt as well. I've been working on the codebase for just a few days, so I might obviously be missing something, but let me explain the reasoning behind the fix and then we could try to find a better path. Sorry for the long reply. Assuming you have the following scenario:
In the current flow, when the user opens the folder The problem here is that the code does not support constructing the
Let me know if any of the other approaches sound better to you, or if you know about any other possible paths I could explore, I will definitely give them a shot. |
Yeah, don't get me wrong. The change does look good but I am extremely conservative when it comes to uri-changes. It's huge source of bikeshedding and there will be many people arguing withs loads of passion why that change isn't good. So, I wonder if we can tackle this at the place in which an untitled file is being saved. Somewhere (@bpasero should know where) the |
|
Reminds me of this series of debt-issues we went through: https://github.com/Microsoft/vscode/issues?utf8=✓&q=is%3Aissue+fsPath+%22Don%27t+call+URI%23fsPath%22+ |
|
Just double-checking before implementing your suggestion, the use case I described above is also replicated in https://github.com/Microsoft/vscode/blob/master/extensions/typescript-language-features/src/utils/tsconfig.ts#L63-L64, and as the screenshot below shows, this patch also fixes that: @jrieken Do you still prefer to address this use case on a case-by-case approach instead of a generic solution? If so, I no worries, I'll submit a new patch. /cc @bpasero |
|
Yeah, I believe a fix in the service for untitled files will also cover the TypeScript part. |
|
Understood! Let me work on that and I'll update the PR. |
4db20e8 to
8093ab5
Compare
|
Looks good to me but I'll leave it up to @bpasero |
bpasero
left a comment
There was a problem hiding this comment.
@LeonardoBraga good catches, I think the fix goes into the right direction with 2 comments:
- there seems to be a third case where we do the wrong case here
- instead of doing
URI.file(resource.fsPath).with({ authority: resource.authority })I would prefer if we didresource.with({ schema: Schemas.file })because that makes the conversion much clearer imho
8093ab5 to
08fc847
Compare
|
@bpasero completely agreed with the recommendation and thanks for pointing out another place that needed the fix. I've updated the PR with the changes you suggested. |
|
@LeonardoBraga thanks 👍 |
Fixes #49851
Improves support to Windows UNC files in a "yet-to-be-saved" state, which addresses the problem with creating
.gitignorein a network folder from "Add to .gitignore" command.