Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno Language Server doesn't work with brackets in filename #21062

Open
1 task done
bhb603 opened this issue Nov 22, 2024 · 1 comment
Open
1 task done

Deno Language Server doesn't work with brackets in filename #21062

bhb603 opened this issue Nov 22, 2024 · 1 comment
Labels
bug [core label] language server failure Language server doesn't work as expected tsx TypeScript JSX support typescript TypeScript programming language support

Comments

@bhb603
Copy link

bhb603 commented Nov 22, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Deno's web app framework "Fresh" uses file-based routing, similar to Nextjs. So in order to create a dynamic route, you create a file with square brackets in the name. E.g. blog/[slug].tsx

When using Zed, it seems the language server does not work in any of these files. None of the language-server intelligence features work, and saving a file (with format_on_save) does not format the file, it throws the following error in the status bar:

Formatting failed: failed to format via language server: unexpected character at index 34. Click to see logs.

Logs:

2024-11-22T09:57:38.924075-05:00 [ERROR] failed to format via language server

Caused by:
    unexpected character at index 34
2024-11-22T09:57:39.185874-05:00 [WARN] Generic lsp request to deno failed: unexpected character at index 34
2024-11-22T09:57:39.18688-05:00 [ERROR] unexpected character at index 34

Note: Unclear if this is a Zed issue or Deno LSP issue... I posted here because I assume the Deno Language Server works with other tools, e..g VS Code seems to work fine with these files.

Reproduce

  1. You can create a whole Fresh project using these instructions, or simply initialize a Deno project and create a file with brackets:
deno init
touch \[slug\].ts
  1. Configure Deno with the extension and project settings described here
  2. Open the project in Zed. Observe that when editing [slug].ts none of the language server features work.

Environment

Zed: v0.162.5 (Zed)
OS: macOS 15.1.0
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
2024-11-22T10:04:44.064274-05:00 [WARN] Generic lsp request to deno failed: unexpected character at index 28
2024-11-22T10:04:44.069489-05:00 [ERROR] unexpected character at index 28
2024-11-22T10:04:44.245233-05:00 [WARN] Generic lsp request to deno failed: unexpected character at index 28
2024-11-22T10:04:44.245702-05:00 [ERROR] unexpected character at index 28
2024-11-22T10:04:44.488342-05:00 [WARN] Generic lsp request to deno failed: unexpected character at index 28
2024-11-22T10:04:44.488796-05:00 [ERROR] unexpected character at index 28
2024-11-22T10:04:44.666697-05:00 [WARN] Generic lsp request to deno failed: unexpected character at index 28
2024-11-22T10:04:44.667181-05:00 [ERROR] unexpected character at index 28
2024-11-22T10:04:44.847615-05:00 [WARN] Generic lsp request to deno failed: unexpected character at index 28
2024-11-22T10:04:44.847916-05:00 [ERROR] unexpected character at index 28
2024-11-22T10:04:44.968886-05:00 [WARN] Generic lsp request to deno failed: unexpected character at index 28
2024-11-22T10:04:44.969372-05:00 [ERROR] unexpected character at index 28
@bhb603 bhb603 added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Nov 22, 2024
@bhb603
Copy link
Author

bhb603 commented Nov 22, 2024

For reference, just found a similar issue in Deno's repo: denoland/deno#26098
They confirmed it was an issue with the editor (Helix in this case).
Seems the solution in that case was to percent-encode the filenames.

@notpeter notpeter added typescript TypeScript programming language support tsx TypeScript JSX support language server failure Language server doesn't work as expected and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language server failure Language server doesn't work as expected tsx TypeScript JSX support typescript TypeScript programming language support
Projects
None yet
Development

No branches or pull requests

2 participants