SIGN IN SIGN UP

fix(intellij): handle square brackets in file paths for autocomplete (#11474)

* fix(intellij): handle square brackets in file paths for autocomplete

Use File.toURI() instead of URI constructor for Windows two-slash
file:// URIs to properly percent-encode special characters like [ ].
Fixes #10978.

* test(intellij): strengthen Windows URI assertions for bracket encoding

Verify that square brackets are percent-encoded and drive letter
and directory structure are preserved in parsed URI path.

* fix(intellij): make Windows bracket test cross-platform

The CI runs on Linux where C: is not a drive letter.
Assert that brackets are encoded and structure is preserved
without platform-specific path assumptions.

* fix: use cross-platform URI constructor instead of File.toURI()

File.toURI() is platform-dependent — on non-Windows hosts it treats
Windows drive paths (e.g. C:/Users/...) as relative paths, producing
corrupted URIs. The multi-arg URI(scheme, host, path, fragment)
constructor is pure RFC 2396 string manipulation and works identically
on all platforms.

Also strengthens the Windows bracket test with exact equality assertions
instead of loose contains/assertFalse checks.

* chore: remove verbose comments for minimal diff

---------

Co-authored-by: Dallin Romney <dallinromney@gmail.com>
T
Taras Malinovskii committed
c5490d97eaa96cd20b570607d21f4bb4dd39fb9e
Parent: afd5e5e
Committed by GitHub <noreply@github.com> on 3/26/2026, 10:12:38 PM