zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.58k stars 3.04k forks source link

"Go to definition" shows blank buffer for Deno code #10108

Open johanbrook opened 7 months ago

johanbrook commented 7 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

  1. Have a configured Deno project in a zed window.
  2. echo "Deno.copyFile" > foo.ts
  3. open -a "/Applications/Zed Preview.app" foo.ts
  4. cmd+click on copyFile method in buffer.

Environment

Zed: v0.129.1 (Zed Preview) OS: macOS 14.4.0 Memory: 32 GiB Architecture: aarch64

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

image

After clicking:

image

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Log for covering the steps above:

2024-04-03T10:15:22+02:00 [INFO] reload git repository ".git"
2024-04-03T10:15:24+02:00 [INFO] open paths ["/Users/brookie/code/johan.im/foo.ts"]
2024-04-03T10:15:24+02:00 [INFO] reload git repository ".git"
2024-04-03T10:15:24+02:00 [INFO] reload git repository ".git"
2024-04-03T10:15:31+02:00 [ERROR] failed to canonicalize root path: No such file or directory (os error 2)
2024-04-03T10:15:31+02:00 [INFO] Initializing default prettier with plugins {}
2024-04-03T10:15:31+02:00 [INFO] Language server with id 3 sent unhandled notification workspace/diagnostic/refresh:
null
2024-04-03T10:15:31+02:00 [ERROR] crates/project/src/project.rs:3139: no worktree found for diagnostics path "/asset/lib.deno.ns.d.ts"
2024-04-03T10:15:31+02:00 [INFO] Language server with id 3 sent unhandled notification workspace/diagnostic/refresh:
null
2024-04-03T10:15:31+02:00 [ERROR] crates/project/src/project.rs:3139: no worktree found for diagnostics path "/asset/lib.deno.ns.d.ts"
2024-04-03T10:15:31+02:00 [ERROR] crates/project/src/project.rs:3139: no worktree found for diagnostics path "/asset/lib.deno.ns.d.ts"
2024-04-03T10:15:32+02:00 [ERROR] crates/project/src/project.rs:3139: no worktree found for diagnostics path "/asset/lib.deno.ns.d.ts"
2024-04-03T10:15:33+02:00 [ERROR] failed to canonicalize root path: No such file or directory (os error 2)
2024-04-03T10:15:33+02:00 [INFO] Initializing default prettier with plugins {}
sigmaSd commented 7 months ago

This requires deno/virtualTextDocument lsp extension https://docs.deno.com/runtime/manual/advanced/language_server/overview

sigmaSd commented 6 months ago

It seems it now crashes the editor instead of showing a blank buffer, because its trying to setup a watcher on the remote module

2024-05-02T19:22:33+01:00 ERROR Zed::reliability] {
  "thread": "<unnamed>",
  "payload": "Could not start watcher on parent directory: Error { kind: Io(Os { code: 2, kind: NotFound, message: \"No such file or directory\" }), paths: [\"/https/jsr.io/@std/path/0.220.1\"] }",
sigmaSd commented 6 months ago

The crash is on linux, seems the watcher on mac have a different implementation

mitchtreece commented 5 days ago

Has there been any movement on this issue? Pretty annoying not being able to jump to a file when working with Deno. Pretty much the only feature stopping me from fully ditching vscode.