Skip to content

Incorrect URI casing passed to extensions on Windows after file rename #137256

Open
@Colengms

Description

@Colengms

Version: 1.62.2 (user setup)
Commit: 3a6960b
Date: 2021-11-11T20:56:38.428Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.22000

On Linux, I'm seeing that a file gets a didClose/didOpen when renamed while open. On Windows, if the rename only alters the casing of the filename, no new didClose/didOpen occurs. VS Code will continue to refer to the file using the old casing. If the workspace is reloaded with the file still open, the new session continues to refer to the file using the old casing.

Our extension (C/C++) relies on VS Code referring to the same file consistently with the same URI, and that URI matching the actual case of the file in the file system. We may need to match paths not received from VS Code, with URIs received from VS Code. We can work around the issue by always going to disk to detect the file system casing before doing any comparison against a URI received from VS Code. Though, I suspect this scenario is a bug and the intention is for VS Code URI's to refer to files consistently with casing that matches the file system.

A potential fix would be to issue didClose/didOpen for files on Windows even if only casing was changed.

Metadata

Metadata

Labels

under-discussionIssue is under discussion for relevance, priority, approachuri

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions