Skip to content

WSL files whose path has a space are not found from their URI: UriConverterManager.findResourceFor decodes before WslUriConverter parses #2354

Done

Description

@d-biehl

In a project inside WSL whose path contains a space, such as \\wsl.localhost\Ubuntu-26.04\home\daniel\robot project, LSP4IJ doesn't find the file of a URI it built itself, so the diagnostics for these files don't appear.

LSP4IJ builds file://wsl.localhost/Ubuntu-26.04/home/daniel/robot%20project/resources/common.resource for the file (WslUriConverter.toUri, fixed in #1794), and the server sends it back unchanged, but LSPIJUtils.findResourceFor(uri) returns null. The log has, for every such URI:

WARN - #com.redhat.devtools.lsp4ij.internal.uri.WslUriConverter - Failed to parse WSL URI: file://wsl.localhost/Ubuntu-26.04/home/daniel/robot project
java.net.URISyntaxException: Illegal character in path at index 51: file://wsl.localhost/Ubuntu-26.04/home/daniel/robot project

The reason: UriConverterManager.findResourceFor URL-decodes every URI that contains % before it asks the converters (for drive letters such as c%3A), and WslUriConverter.findResourceFor then parses the decoded string with new URI(uri), which rejects the space. The same URIs without a space resolve fine.

Seen with LSP4IJ 0.30.1 and PyCharm 2026.3.0.2 on Windows 11 with WSL 2; both places are the same on main. Since URI.getPath() already decodes, the WSL converter could perhaps get the URI before the decoding.

Activity

  1. added
    bug
    on Nov 28, 2026
  2. added this to the 0.30.3 milestone on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions