Commit c5490d9
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>1 parent afd5e5e commit c5490d9
File tree
2 files changed
+16
-1
lines changed- extensions/intellij/src
- main/kotlin/com/github/continuedev/continueintellijextension/continue
- test/kotlin/com/github/continuedev/continueintellijextension/unit
2 files changed
+16
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
63 | 78 | | |
0 commit comments