Skip to content

Fix Windows-only LSP errors: URI %3A decoding and quoted .rsp lines#886

Merged
DavidObando merged 1 commit into
mainfrom
daobando/fix-885-windows-lsp-errors
Jun 17, 2026
Merged

Fix Windows-only LSP errors: URI %3A decoding and quoted .rsp lines#886
DavidObando merged 1 commit into
mainfrom
daobando/fix-885-windows-lsp-errors

Conversation

@DavidObando

Copy link
Copy Markdown
Owner

Fixes #885

Two Windows-specific bugs prevented the language server from resolving projects and references correctly:

Bug 1 - URI %3A decoding (src/LanguageServer/Protocol/Models.cs): VS Code sends percent-encoded drive-letter colons (file:///c%3A/...). Uri.LocalPath decoded %3A but kept a leading /, producing /c:/Users/... which Path.GetFullPath mangled into C:\c:\Users.... This broke all file-to-project lookups - every file compiled standalone without cross-file awareness.

Bug 2 - Quoted .rsp lines (src/LanguageServer/ProjectDiscovery.cs): MSBuild on Windows wraps entire switches in quotes when paths contain spaces. The parser only recognized lines starting with / or -, silently dropping all core .NET framework references. For the Oahu E2E test project, only 15 of 182 references were loaded.

Both bugs are Windows-specific (macOS has no drive letters and no Program Files paths).

Verification:

  • References discovered for E2E test project: 15 to 182
  • All 4 URI format variants now resolve correctly to their project
  • 238/238 LanguageServer tests pass (10 new tests added)

…885)

Two Windows-specific bugs prevented the language server from resolving
projects and references correctly:

1. DocumentUri.GetFileSystemPath() did not strip the leading '/' from
   paths produced by Uri.LocalPath when VS Code sends percent-encoded
   drive-letter colons (file:///c%3A/...). This produced /c:/... which
   Path.GetFullPath mangled into C:\c:\..., breaking all file-to-project
   lookups.

2. ParseReferencesFromResponseFile skipped lines where MSBuild wraps the
   entire switch in quotes (e.g. "/r:C:\Program Files\..."), which is
   the standard format for paths containing spaces on Windows. This
   silently dropped all core .NET framework references.
@DavidObando DavidObando added bug Something isn't working Oats Overnight Autonomous Tool System labels Jun 17, 2026
@DavidObando DavidObando merged commit 7f4ebd7 into main Jun 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Oats Overnight Autonomous Tool System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language server in Windows produces a wall of errors, clean on macOS

1 participant