redhat-developer / redhat-developer/vscode-xml

xml.catalogs entries with Windows backslash paths are silently ignored

Open
#1,155 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

invalid
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

  1. Place a catalog file at C:\Users\chirag\project\schemas\catalog.xml.
  2. Add to VS Code settings (settings.json, workspace scope):
    "xml.catalogs": ["C:\Users\chirag\project\schemas\catalog.xml"]
    
  3. Open an XML file that references a schema resolved via that catalog.
  4. No schema validation occurs; hovering over the root element shows no type info.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.