redhat-developer / redhat-developer/vscode-xml
xml.catalogs entries with Windows backslash paths are silently ignored
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 328
- Forks
- 101
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 7
Description
Problem
The xml.catalogs setting accepts an array of file paths to XML catalog files. On Windows, if those paths use backslashes (as vscode.Uri.fsPath produces), the XML Language Server silently fails to load the catalog and falls back to no-validation mode. No error or warning is shown in the Output channel or as a squiggly.
Steps to Reproduce
- Place a catalog file at
C:\Users\chirag\project\schemas\catalog.xml. - Add to VS Code settings (settings.json, workspace scope):
"xml.catalogs": ["C:\Users\chirag\project\schemas\catalog.xml"] - Open an XML file that references a schema resolved via that catalog.
- No schema validation occurs; hovering over the root element shows no type info.
- Workaround: manually replacing backslashes with forward slashes in the setting value fixes the issue:
"xml.catalogs": ["C:/Users/chirag/project/schemas/catalog.xml"]
Root Cause
The XML Language Server (LemMinX) receives the raw string from the VS Code setting and passes it directly to the Java URI constructor or File constructor. On Windows, new URI("C:\path") is not valid; it must be new URI("file:///C:/path") or at minimum use forward slashes.
Expected Behaviour
The extension should normalise catalog paths before sending them to the language server:
const normalised = vscode.Uri.file(rawPath).toString(); // file:///C:/Users/...
Or the language server should accept and convert Windows-style paths.
Why This Matters
Windows users who configure xml.catalogs via the VS Code settings UI or who paste paths from Windows Explorer will naturally use backslashes. The silent failure is very confusing.
Environment
- OS: Windows 11 Enterprise 10.0.26200
- VS Code: 1.89+
- Extension: redhat.vscode-xml latest
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the xml.catalogs setting from the VS Code extension into the language server, focusing on how Windows backslash paths are passed to URI or file handling. Reproduce with a catalog path like C:\Users... and compare it with the forward-slash workaround. Done means Windows-style catalog paths load successfully and XML validation or hover information appears instead of silently falling back.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100