Skip to content

Commit d69a41f

Browse files
jdesrosiersclaude
andcommitted
Keep TestClient URIs in the form the server sees them
VS Code lowercases the drive letter on Windows, so the URIs TestClient sends are "file:///c%3A/...", which the server normalizes to "file:///c:/...". Normalization doesn't change the case of a path, but TestClient built its URIs from pathToFileURL, which keeps "C:". On Windows, diagnostics and messages with URIs no longer matched what the tests expected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent eb30085 commit d69a41f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎language-server/src/test/TestClient.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ export class TestClient {
6666
this.serverName = serverName;
6767
this.watchEnabled = false;
6868
this.openDocuments = new Set();
69-
// The "@" is percent-encoded by toClientUri, so URIs from the client never match normalized URIs as-is
69+
// The "@" is percent-encoded by toClientUri, so URIs from the client never match normalized URIs as-is.
70+
// URIs are kept in the form the server sees them, which includes VS Code's lowercase drive letter on Windows.
7071
this.workspaceFolder = mkdtemp(join(tmpdir(), "test-workspace@"))
71-
.then((path) => normalizeIri(pathToFileURL(path).toString()));
72+
.then((path) => normalizeIri(toClientUri(pathToFileURL(path).toString())));
7273
this.gitignore = this.workspaceFolder.then(async (rootPath) => {
7374
const gitignorePath = join(rootPath, ".gitignore");
7475
try {

0 commit comments

Comments
 (0)