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.79k stars 2.8k forks source link

Vue LSP not working #12384

Open Runkunkun opened 4 months ago

Runkunkun commented 4 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Vue Autocompletion and Import stopped working after updating Zed. I already tried deleting the languages and extensions folder, that seemed to fix the problem in the past.

Environment

Zed: v0.136.2 (Zed) OS: macOS 14.4.1 Memory: 32 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.

2024-05-28T17:26:08+02:00 [INFO] Initializing default prettier with plugins {} 2024-05-28T17:26:08+02:00 [INFO] starting language servers for Vue.js: tailwindcss-language-server, eslint, vue-language-server

2024-05-28T17:26:08+02:00 [WARN] Skipping path "/Users/lukas.kurth" that has no prettier dependency and no workspaces section in its package.json 2024-05-28T17:26:08+02:00 [INFO] Language server with id 3 sent unhandled notification eslint/status: { "uri": "file:///Users/lukas.kurth/Repositories/cookbook-recipes/components/web-apps/private-recipes/src/components/DynamicImageList.vue", "state": 1, "validationTime": 21 } 2024-05-28T17:26:11+02:00 [INFO] Language server with id 3 sent unhandled notification eslint/status: { "uri": "file:///Users/lukas.kurth/Repositories/cookbook-recipes/components/web-apps/private-recipes/src/components/DynamicImageList.vue", "state": 1, "validationTime": 16 } 2024-05-28T17:26:12+02:00 [INFO] Language server with id 3 sent unhandled notification eslint/status: { "uri": "file:///Users/lukas.kurth/Repositories/cookbook-recipes/components/web-apps/private-recipes/src/components/DynamicImageList.vue", "state": 1, "validationTime": 15 } 2024-05-28T17:26:13+02:00 [INFO] Language server with id 3 sent unhandled notification eslint/status: { "uri": "file:///Users/lukas.kurth/Repositories/cookbook-recipes/components/web-apps/private-recipes/src/components/DynamicImageList.vue", "state": 1, "validationTime": 14 } 2024-05-28T17:26:13+02:00 [INFO] Language server with id 3 sent unhandled notification eslint/status: { "uri": "file:///Users/lukas.kurth/Repositories/cookbook-recipes/components/web-apps/private-recipes/src/components/DynamicImageList.vue", "state": 1, "validationTime": 13 }

JosephTLyons commented 4 months ago

Hey @Runkunkun - are you still running into the issue or are you able to reproduce it?

d1y commented 4 months ago

Most likely the same problem as https://github.com/zed-industries/zed/issues/9388#issuecomment-2076205428

Runkunkun commented 4 months ago

Still having the problem, across all my vue projects. Typescript is installed as dev dependency and reinstalling the extension did not fix it, so probably a different Problem than #9388?

joshuaia commented 4 months ago

Maybe related to https://github.com/zed-industries/zed/issues/12019 I'm still having this issue.

jaekong commented 3 months ago

I am unsure if this is the same case, but in my case it seems like for some reason Zed isn't resolving peerDependencies for vue-language-server, therefore not installing typescript in ~/Library/Application Support/Zed/extensions/work/vue/node_modules

I tried to manually copy and paste typescript from other places, but to no avail. It just deletes everything and re-installs extension again.

2024-06-07T21:30:42+09:00 [INFO] starting language server "vue-language-server", path: "/Users/jae/local_ongoing_works/portfolio-rework/portfolio", id: 9
2024-06-07T21:30:42+09:00 [INFO] Node runtime install_if_needed
2024-06-07T21:30:43+09:00 [INFO] starting language server. binary path: "/Users/jae/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/jae/local_ongoing_works/portfolio-rework/portfolio", args: ["/Users/jae/Library/Application Support/Zed/extensions/work/vue/node_modules/@vue/language-server/bin/vue-language-server.js", "--stdio"]
2024-06-07T21:30:43+09:00 [ERROR] failed to start language server "vue-language-server": Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in node_modules/typescript/lib
2024-06-07T21:30:43+09:00 [ERROR] server stderr: Some("")
2024-06-07T21:30:43+09:00 [ERROR] Hit 4 reinstallation attempts for "vue-language-server"
2024-06-07T21:30:43+09:00 [ERROR] crates/lsp/src/lsp.rs:782: oneshot canceled
freedomlang commented 3 months ago

I am unsure if this is the same case, but in my case it seems like for some reason Zed isn't resolving peerDependencies for vue-language-server, therefore not installing typescript in ~/Library/Application Support/Zed/extensions/work/vue/node_modules

I tried to manually copy and paste typescript from other places, but to no avail. It just deletes everything and re-installs extension again.

2024-06-07T21:30:42+09:00 [INFO] starting language server "vue-language-server", path: "/Users/jae/local_ongoing_works/portfolio-rework/portfolio", id: 9
2024-06-07T21:30:42+09:00 [INFO] Node runtime install_if_needed
2024-06-07T21:30:43+09:00 [INFO] starting language server. binary path: "/Users/jae/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/jae/local_ongoing_works/portfolio-rework/portfolio", args: ["/Users/jae/Library/Application Support/Zed/extensions/work/vue/node_modules/@vue/language-server/bin/vue-language-server.js", "--stdio"]
2024-06-07T21:30:43+09:00 [ERROR] failed to start language server "vue-language-server": Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in node_modules/typescript/lib
2024-06-07T21:30:43+09:00 [ERROR] server stderr: Some("")
2024-06-07T21:30:43+09:00 [ERROR] Hit 4 reinstallation attempts for "vue-language-server"
2024-06-07T21:30:43+09:00 [ERROR] crates/lsp/src/lsp.rs:782: oneshot canceled

Having the same error message of vue-language-server

Zed: v0.140.5 (Zed) OS: macOS 14.4.1 Memory: 16 GiB Architecture: aarch64

chadsmith12 commented 3 months ago

I'm also having an issue with the Vue LSP, and for me I've narrowed down to purely Nuxt vs. a regular Vue Project created by Vite.

If I open up my Nuxt Project inside Zed the Vue LSP Never kicks in and starts up it seems. I can see the following logs for the vue-language-server:

2024-06-25T10:06:03-05:00 [INFO] starting language server. binary path: "/Users/chadsmith/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/chadsmith/Projects/myproject/src/app", args: ["/Users/chadsmith/Library/Application Support/Zed/extensions/work/vue/node_modules/@vue/language-server/bin/vue-language-server.js", "--stdio"]
2024-06-25T10:06:03-05:00 [ERROR] failed to start language server "vue-language-server": Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in node_modules/typescript/lib
2024-06-25T10:06:03-05:00 [ERROR] server stderr: Some("")

If I keep that instance of Zed running, and open up a regular Vue project that I created using Vite the LSP in the logs look like that it starts up, but I don't ever receive anything LSP Messages when inside a Vue file or even a TypeScript File.

2024-06-25T10:11:39-05:00 [INFO] starting language servers for Vue.js: tailwindcss-language-server, eslint, vue-language-server

Now if I completely close out all of those Zed instances and only re-open the the regular Vue projected created, the LSP starts to work normally again and I can see the LSP Messages coming in from the vue-language-server in the logs.

Zed: 0.140.5 MacOS: 14.4, 32gb, M2 Max

Hope this information helps any, and let me know if anymore logs could help.

maxdeviant commented 2 months ago

We just released v0.1.0 of the Vue extension.

Can the folks who are having issues try it out with that version and see if you still encounter the same issues?

If you are still having issues, a project you can share with us that demonstrates the problem would be very helpful in diagnosing and remediating the issue!

fazulk commented 2 months ago

This is still an issue, which makes zed un-usable with vue. Although it used to work fine- not sure what happened. Here is a repo you where you can reproduce auto complete not working, as well as go to definition not working within .vue files.

https://github.com/fazulk/vue-zed-demo

g5becks commented 1 month ago

Wanted to give zed a try today as well. And the Vue extension is not working for me either.