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
47.97k stars 2.83k forks source link

`CMD` + click not working in `PHP` files #10367

Open widersky opened 5 months ago

widersky commented 5 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I'm pretty sure that before PHP support was separated into an extension, the CMD + click action worked. The issue does not occur in other supported languages.

Environment

Zed: v0.130.4 (Zed Preview) OS: macOS 14.4.1 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 ~/Library/Logs/Zed/Zed.log file to this issue.

No response

xcrap commented 5 months ago

Not only that the formatter stopped working for me as well.... :\

JosephTLyons commented 5 months ago

Hey @xcrap @widersky, do you have anything in your logs related to the PHP language server? Any sort of failures or crashes?

widersky commented 5 months ago

@JosephTLyons nothing here

xcrap commented 5 months ago

This is my log:

2024-04-11T17:48:51+00:00 [INFO] ========== starting zed ========== 2024-04-11T17:48:51+00:00 [INFO] Opening main db 2024-04-11T17:48:51+00:00 [INFO] Using git binary path: Some("/Applications/Zed.app/Contents/MacOS/git") 2024-04-11T17:48:51+00:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0 2024-04-11T17:48:51+00:00 [ERROR] crates/zed/src/zed.rs:631: EOF while parsing a value at line 1 column 0 2024-04-11T17:48:51+00:00 [INFO] Opening main db 2024-04-11T17:48:52+00:00 [INFO] set status on client 0: Authenticating 2024-04-11T17:48:52+00:00 [INFO] building git repository, .git path in the worktree: ".git" 2024-04-11T17:48:52+00:00 [INFO] building git repository, .git path in the worktree: ".git" 2024-04-11T17:48:52+00:00 [INFO] building git repository, .git path in the worktree: ".git" 2024-04-11T17:48:52+00:00 [INFO] set status on client 98447: Connecting 2024-04-11T17:48:52+00:00 [INFO] Opening main db 2024-04-11T17:48:52+00:00 [INFO] starting language server "tailwindcss-language-server", path: "/Users/xcrap/htdocs/micauto", id: 1 2024-04-11T17:48:52+00:00 [INFO] starting language server "intelephense", path: "/Users/xcrap/htdocs/micauto", id: 2 2024-04-11T17:48:52+00:00 [INFO] set environment variables from shell:/bin/zsh, path:/Users/xcrap/.bun/bin:/opt/homebrew/opt/curl/bin:/opt/homebrew/opt/curl/bin:/opt/homebrew/opt/curl/bin:/Users/xcrap/Library/Application Support/Herd/bin/:/Users/xcrap/miniconda3/bin:/Users/xcrap/miniconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/xcrap/.nvm/versions/node/v20.10.0/bin:/Applications/MAMP/bin/php/php8.2.4/bin:/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://Applications/Topaz Photo AI.app/Contents/Resources/bin:/Users/xcrap/Library/Application Support/JetBrains/Toolbox/scripts 2024-04-11T17:48:52+00:00 [INFO] fetching latest version of language server "tailwindcss-language-server" 2024-04-11T17:48:52+00:00 [INFO] Node runtime install_if_needed 2024-04-11T17:48:52+00:00 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc 2024-04-11T17:48:52+00:00 [INFO] Node runtime install_if_needed 2024-04-11T17:48:53+00:00 [INFO] Node runtime install_if_needed 2024-04-11T17:48:53+00:00 [INFO] add connection to peer 2024-04-11T17:48:53+00:00 [INFO] waiting for server hello 2024-04-11T17:48:53+00:00 [INFO] got server hello 2024-04-11T17:48:53+00:00 [INFO] set status to connected (connection id: ConnectionId { owner_id: 0, id: 0 }, peer id: PeerId { owner_id: 387, id: 3815456 }) 2024-04-11T17:48:53+00:00 [INFO] set status on client 98447: Connected { peer_id: PeerId { owner_id: 387, id: 3815456 }, connection_id: ConnectionId { owner_id: 0, id: 0 } } 2024-04-11T17:48:53+00:00 [INFO] starting language server. binary path: "/Users/xcrap/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/", args: ["/Users/xcrap/Library/Application Support/Zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]

I have no idea what's going on hehe. Also is there a command to clear logs ?

widersky commented 5 months ago

@JosephTLyons it's strange but now it's working without any action from my side 🤔

EDIT: Restarted Zed, doesn't work again, logs are empty :/

xcrap commented 5 months ago

The ctrl + action works fine, the syntax highlight works fine, the formatter makes absolutely nothing in my case :\

jigarvyas commented 5 months ago

Started noticing these around after PHP support was extracted into an extension For me go to definition is working fine (Zed Preview 0.131.3), but no formatting I had to rollback to v0.128.3

maxdeviant commented 5 months ago

Started noticing these around after PHP support was extracted into an extension For me go to definition is working fine (Zed Preview 0.131.3), but no formatting I had to rollback to v0.128.3

Would you mind checking what versions of Intelephense are in use by each version?

For the built-in PHP support the version can be retrieved from:

cat ~/Library/Application\ Support/Zed/languages/intelephense/node_modules/intelephense/package.json

For the extension PHP support it can be retrieved from:

cat ~/Library/Application\ Support/Zed/extensions/work/php/node_modules/intelephense/package.json
jigarvyas commented 5 months ago

@maxdeviant Same for both

"name": "intelephense",
"version": "1.10.4",
asim-blueprintprep commented 5 months ago

Seeing the same issue (cmd click not working) with Zed 0.130.6 / PHP extension 0.0.2 / intelephense 1.10.4

hafidluqman50 commented 5 months ago

still have same issue today working with Zed 0.133.5 / PHP Extension 0.0.2 / intelephense 1.10.4

maxdeviant commented 5 months ago

For the folks having issues could you try adding the following to your settings in Zed 0.133.5:

{
  "languages": {
    "PHP": {
      "language_servers": ["intelephense", "..."]
    }
  }
}
widersky commented 5 months ago

@maxdeviant it's working here!

mansoorkhan96 commented 4 months ago

Has stoped working for me too.

Go to definition or find references does not work anymore.

These are the two errors i can see in the log.

2024-05-16T22:32:41+05:00 [WARN] Generic lsp request to node failed: Unhandled method textDocument/definition
2024-05-16T22:32:41+05:00 [ERROR] crates/editor/src/element.rs:287: Unhandled method textDocument/definition
mansoorkhan96 commented 4 months ago

ok i started debugging by removing extensions one by one.

and the Emmet extension was the culprit 😅

alexthekiwi commented 4 months ago

@mansoorkhan96 that was driving me crazy, I was sure it was working yesterday and it suddenly stopped. Forgot I had installed the Emmet extension..

widersky commented 4 months ago

@alexthekiwi Emmet needs some improvement for sure. For example you have to open single HTML file to make it work in PHP files as well 😅

hareshgediya commented 2 months ago

When I'm connecting with remote server via SSH that time it is not working.