denoland / vscode_deno

Visual Studio Code plugin for Deno
https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
MIT License
1.5k stars 146 forks source link

Unable to convert file URL with square brackets to URI #1157

Closed JTRNS closed 2 months ago

JTRNS commented 2 months ago

Describe the bug

File names with square brackets, used in Fresh and other frameworks for dynamic file based routing, seem to break the extension.

Could not convert URL "file:///home/jtrns/tmp/deno-lsp-brackets/[main].tsx" to URI: unexpected character at index 41
Unable to convert fix: unexpected character at index 41
[Error - 11:30:53 AM] Request textDocument/codeAction failed.
  Message: Internal error
  Code: -32603

file:///home/jtrns/tmp/deno-lsp-brackets/[main].tsx".indexOf("[") // 41

To Reproduce

  1. Open empty directory in vscode
  2. Run Deno enable command
  3. Create a [main].ts
  4. Start writing code

Expected behavior

The LSP should be able to parse paths that contain brackets.

Versions

vscode: Version: 1.93.0 (system setup) Commit: 4849ca9bdf9666755eb463db297b69e5385090e3 Date: 2024-09-04T13:02:38.431Z Electron: 30.4.0 ElectronBuildId: 10073054 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22631

deno: Version: 1.46.3 (stable, release, x86_64-unknown-linux-gnu) v8 12.9.202.5-rusty typescript 5.5.2

extension: v3.39.0