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
59.96k stars 4.25k forks source link

LSP tasks and Tree-sitter tasks are not always properly merged in the gutter popover #29011

Closed MrSubidubi closed 1 month ago

MrSubidubi commented 1 month ago

Summary

Some tasks are missing in the popover menu which appears if you click on the Run symbol in the gutter. Other tasks spawn an empty entry in the appearing list which cannot be clicked (also no hover events are triggered upon hovering the empty entry). The missing tasks do show if you use the tasks: spawn action over the command palette.

Image Image

(Notice the small empty menu on the left in the second image)

Steps to reproduce:

  1. Clone the Zed-repo.
  2. Open any buffer and wait for r-a to finish indexing.
  3. Search for test_wrapped globallly.
  4. Click with the mouse on one of the tests test_wrapped_lines or test_wrap_line and use "g space" to jump to that line.
  5. Click on the Run - button in the gutter.

Expected Behavior: A list of all tasks that can be run shows.

Actual Behavior: Sometimes no task (and an empty menu) is shown, sometimes a dead entry appears in the list.

If you need any more information, please let me know.

Settings ```jsonc { "dev": { "minimap": { "show": "always", "font_size": 5 }, "scrollbar": { "show": "never" } // "soft_wrap": "editor_width" }, "auto_update_extensions": { "catppuccin": false }, "show_edit_predictions": true, "features": { "edit_prediction_provider": "zed" }, "buffer_line_height": "comfortable", "icon_theme": "Zed (Default)", "edit_predictions": { "disabled_globs": [".env"], "mode": "subtle" }, "max_tabs": 10, "assistant": { "enabled": true, "button": true, "version": "2", "default_model": { "provider": "zed.dev", "model": "claude-3-7-sonnet-latest" } }, "completions": { "lsp_insert_mode": "replace_subsequence" }, "relative_line_numbers": true, "preview_tabs": { "enable_preview_from_code_navigation": true }, "tabs": { "file_icons": true, "git_status": true, "show_diagnostics": "all" }, "when_closing_with_no_tabs": "keep_window_open", "wrap_guides": [86, 100], "preferred_line_length": 82, "tab_size": 4, "vim_mode": true, "confirm_quit": true, "autosave": "on_focus_change", "format_on_save": "on", "theme": { "mode": "system", "light": "One Light", "dark": "Catppuccin Macchiato - No Italics" }, "lsp": { "pyright": { "settings": { "python.analysis": { "diagnosticMode": "workspace", "typeCheckingMode": "basic" }, "python": { "pythonPath": ".venv/bin/python" } } }, "ruff": { "initialization_options": { "settings": { // Ruff server settings goes here "lineLength": 80, "lint": { "extendSelect": ["I"] } } } } }, "languages": { "TOML": { "show_edit_predictions": true }, "JSONC": { "show_edit_predictions": true }, "HTML": { "format_on_save": "off" }, "Markdown": { "show_edit_predictions": false }, "Python": { "format_on_save": "on", "formatter": [ { "code_actions": { "source.organizeImports.ruff": true, "source.fixAll.ruff": true } }, { "language_server": { "name": "ruff" } } ], "language_servers": ["basedpyright", "ruff"] }, "CSharp": { "formatter": { "external": { "command": "dotnet", "arguments": [ "csharpier", "--no-msbuild-check", "--write-stdout" ] } }, "language_servers": ["omnisharp"] }, "Tree-sitter Query": { "tab_size": 2 }, "Scheme": { "tab_size": 2 } } } ```
Zed Log ``` 2025-04-18T01:48:04+02:00 INFO [zed] ========== starting zed ========== 2025-04-18T01:48:05+02:00 INFO [db] Opening main db 2025-04-18T01:48:05+02:00 INFO [db] Opening main db 2025-04-18T01:48:05+02:00 INFO [zed] Using git binary path: Some("/Applications/Zed Nightly.app/Contents/MacOS/git") 2025-04-18T01:48:05+02:00 INFO [prompt_store] No prompt template overrides directory found at /Users/fpe/.config/zed/prompt_overrides. Using built-in prompts. 2025-04-18T01:48:05+02:00 INFO [extension_host] extensions updated. loading 18, reloading 0, unloading 0 2025-04-18T01:48:05+02:00 INFO [db] Opening main db 2025-04-18T01:48:05+02:00 INFO [util] set environment variables from shell:/bin/zsh, path:/Users/fpe/Library/Application Support/Herd/bin/:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Users/fpe/.cargo/bin:/Users/fpe/.dotnet/tools 2025-04-18T01:48:05+02:00 INFO [client] set status on client 0: Authenticating 2025-04-18T01:48:05+02:00 INFO [worktree] containing git repository: None 2025-04-18T01:48:05+02:00 INFO [client] set status on client 161400: Connecting 2025-04-18T01:48:05+02:00 INFO [db] Opening main db 2025-04-18T01:48:05+02:00 INFO [db] Opening main db 2025-04-18T01:48:05+02:00 INFO [workspace] open paths ["/Users/fpe/.config/zed/settings.json"] 2025-04-18T01:48:05+02:00 INFO [db] Opening main db 2025-04-18T01:48:05+02:00 INFO [worktree] containing git repository: None 2025-04-18T01:48:05+02:00 INFO [project] attempting to start language server "json-language-server", path: "/Users/fpe/.config/zed/settings.json", id: 1 2025-04-18T01:48:05+02:00 INFO [project] Initializing default prettier with plugins {} 2025-04-18T01:48:05+02:00 INFO [project] Finish deserializing breakpoints & initializing breakpoint store 2025-04-18T01:48:05+02:00 INFO [project] Initializing default prettier with plugins {} 2025-04-18T01:48:05+02:00 INFO [project] attempting to start language server "rust-analyzer", path: "/Users/fpe/Documents/Projekte/zed", id: 2 2025-04-18T01:48:05+02:00 INFO [client] connected to rpc endpoint https://collab.zed.dev/rpc 2025-04-18T01:48:05+02:00 INFO [project] Initializing default prettier with plugins {} 2025-04-18T01:48:05+02:00 INFO [project] using project environment variables shell launched in "/Users/fpe/Documents/Projekte/zed". PATH="/Users/fpe/Library/Application Support/Herd/bin/:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Users/fpe/Library/Application Support/Herd/bin/:/Users/fpe/.cargo/bin:/Users/fpe/.dotnet/tools:/Users/fpe/.dotnet/tools" 2025-04-18T01:48:05+02:00 INFO [languages] found rust-analyzer in PATH. trying to run `rust-analyzer --help` 2025-04-18T01:48:05+02:00 INFO [project] using project environment variables shell launched in "/Users/fpe/.config/zed". PATH="/Users/fpe/Library/Application Support/Herd/bin/:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Users/fpe/Library/Application Support/Herd/bin/:/Users/fpe/.cargo/bin:/Users/fpe/.dotnet/tools:/Users/fpe/.dotnet/tools" 2025-04-18T01:48:05+02:00 INFO [language] fetching latest version of language server "json-language-server" 2025-04-18T01:48:06+02:00 INFO [project] Initializing default prettier with plugins {} 2025-04-18T01:48:06+02:00 INFO [*unknown*] add_connection; 2025-04-18T01:48:06+02:00 INFO [client] set status on client 161400: Connected { peer_id: PeerId { owner_id: 733, id: 1388864 }, connection_id: ConnectionId { owner_id: 0, id: 0 } } 2025-04-18T01:48:06+02:00 INFO [project] Initializing default prettier with plugins {} 2025-04-18T01:48:06+02:00 INFO [language] fetching latest version of language server "rust-analyzer" 2025-04-18T01:48:06+02:00 INFO [language] language server "json-language-server" is already installed 2025-04-18T01:48:06+02:00 INFO [lsp] starting language server process. binary path: "/opt/homebrew/bin/node", working directory: "/Users/fpe/.config/zed", args: ["/Users/fpe/Library/Application Support/Zed/languages/json-language-server/node_modules/vscode-langservers-extracted/bin/vscode-json-language-server", "--stdio"] 2025-04-18T01:48:06+02:00 INFO [project] Initializing default prettier with plugins {} 2025-04-18T01:48:07+02:00 INFO [language] downloading language server "rust-analyzer" 2025-04-18T01:48:07+02:00 INFO [lsp] starting language server process. binary path: "/Users/fpe/Library/Application Support/Zed/languages/rust-analyzer/rust-analyzer-2025-04-14", working directory: "/Users/fpe/Documents/Projekte/zed", args: [] 2025-04-18T01:49:19+02:00 INFO [db] Opening main db ```

Zed Version and System Specs

Zed: v0.184.0 (Zed Nightly 5ebb18c47e5fc283e2afada6dd434be33f0618e6) OS: macOS 15.0.1 Memory: 8 GiB Architecture: aarch64

SomeoneToIgnore commented 1 month ago

I wonder if there are any other details missing? So far, I had no luck on my machine locally:

https://github.com/user-attachments/assets/be819526-c684-45e7-ad6e-a1948108038d

At least, interesting to see if the logs have anything suspicious. And whether it's r-a being too slow to respond in this case or Zed doing something odd.

MrSubidubi commented 1 month ago

Really sorry for not including that information earlier, half of my mind was still dealing with why the test failed I suppose.

I added the log and also my settings just in case. I also tried describing my reproduction steps more thoroughly, which also made it more reproducable on my end. Thanks for looking at it, I hope that you can reproduce now. Feel free to let me know either way.

MrSubidubi commented 1 month ago

I rechecked just now and figured the missing detail is that you have the debugger feature flag whilst I do not.

Within my debug build, I was also unable to reproduce and everything worked fine. However, once I set ZED_DISABLE_STAFF within my environment, I was able to constantly reproduce following the steps I described above.

SomeoneToIgnore commented 1 month ago

The last bit was a very nice find, thank you, I've managed to repro and have a fix here: https://github.com/zed-industries/zed/pull/29056 can you confirm that it fixes the issue for you too?

MrSubidubi commented 1 month ago

Checked it just now, and it fixes the issue for me too. Thank you for looking into it and the quick fix!