zed icon indicating copy to clipboard operation
zed copied to clipboard

Vue "Go to definition" no longer works

Open amir20 opened this issue 1 year ago • 12 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

I thought I was doing something wrong, but started recently. Zed's command+click or right click to go to definition no longer works in Vue files.

I have tested with a brand new project with pnpm create vite and then use Vue as template.

Note that react using pnpm create vite still works.

Environment

Zed: v0.148.1 (Zed) OS: macOS 14.6.1 Memory: 16 GiB Architecture: aarch64

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

https://github.com/user-attachments/assets/f8005875-12e0-4d90-acaf-93ff9a29a53d

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

Zed.log

amir20 avatar Aug 19 '24 15:08 amir20

Note in the video the first window is a React example and second is the broken experience in Vue.

amir20 avatar Aug 19 '24 15:08 amir20

related to this issue https://github.com/zed-industries/zed/issues/14723

fazulk avatar Aug 19 '24 16:08 fazulk

That's funny because autocomplete works me. 🤷🏼‍♂️

amir20 avatar Aug 19 '24 16:08 amir20

I think you can provide the logs. I suspect that you may have installed other plugins?

d1y avatar Aug 19 '24 16:08 d1y

Updated with logs. Attached screenshot with extensions.

This used to work. But now it is broken all my vue projects so I don't think it's related to something I am doing.

Screenshot 2024-08-19 at 9 59 42 AM

amir20 avatar Aug 19 '24 17:08 amir20

@amir20 I have also reproduced this issue and found that it seems to be caused by tailwindcss lsp(maybbbbe?) Please try disabling it After disabling it, I can work

{
	// disable tailwindcss
	"language_servers": ["!eslint", "!typescript-language-server", "!tailwindcss-language-server", "..."],
}

https://github.com/user-attachments/assets/695be601-ce26-42a8-934a-be2c41e7263f

d1y avatar Aug 19 '24 17:08 d1y

Confirmed. "language_servers": ["!tailwindcss-language-server"] fixes the issue. Now the problem is, I do use Tailwind too.

Is this related to https://github.com/zed-industries/zed/issues/14723? It doesn't seem like it.

amir20 avatar Aug 19 '24 18:08 amir20

I downgraded back to 1.147.2 and go to/code navigation started working again.

I also disabled auto updating as I lost half a day due to this

vknowles-rv avatar Aug 19 '24 20:08 vknowles-rv

Yea I think I misspoke. Even with tailwind disabled I see this happening. I am wondering if some extension got auto updated.

I also lost a lot of time. Going back to Vscode for a while.

amir20 avatar Aug 19 '24 20:08 amir20

Disabling the Tailwind extension with "language_servers": ["!tailwindcss-language-server"] worked for me too.

icarusgk avatar Aug 20 '24 23:08 icarusgk

I don't even have the Tailwind extension, so it doesn't work even with "language_servers": ["!tailwindcss-language-server"]

danulqua avatar Aug 21 '24 06:08 danulqua

@danulqua Try adding the three dots at the end "language_servers": ["!tailwindcss-language-server", "..."]

icarusgk avatar Aug 21 '24 21:08 icarusgk

I downgraded back to 1.147.2 and go to/code navigation started working again.

Downgrading worked for me, too. Setting "language_servers": ["!tailwindcss-language-server", "..."] did not, unfortunately.

flootr avatar Aug 22 '24 06:08 flootr

@icarusgk didn't work. Go to definition doesn't work at all everywhere, in <template> and in <script>.

danulqua avatar Aug 22 '24 06:08 danulqua

I have something that looks like a fix, waiting for the review/confirmation: https://github.com/zed-industries/zed/pull/16654

Meanwhile, using

"languages": {
  "Vue.js": {
    // this is a new line
    "language_servers": ["vue-language-server", "..."],
    "prettier": {
      "allowed": true
    }
  },
}

could help as a workaround.

SomeoneToIgnore avatar Aug 22 '24 08:08 SomeoneToIgnore

Thank you @SomeoneToIgnore, That works! 🚀

icarusgk avatar Aug 22 '24 11:08 icarusgk

Thank you @SomeoneToIgnore for the great work.

amir20 avatar Aug 22 '24 16:08 amir20

Hello, same thing with Astro.

Used:

  "languages": {
    "Astro": {
      "language_servers": ["astro-language-server"]
    },
    ...
  }

misaelvillaverde avatar Aug 26 '24 16:08 misaelvillaverde

Astro seems to have a single language server supported, so this seems a bit unrelated: the current workaround forces a certain, primary, language server to be used first, e.g. :

    "language_servers": ["vue-language-server", "..."],

which is not applicable to a single entry, really.

SomeoneToIgnore avatar Aug 26 '24 16:08 SomeoneToIgnore

I understand, but the "go to definition" doesn't work in astro files (at least on my end) without explicitly setting that up.

misaelvillaverde avatar Aug 26 '24 18:08 misaelvillaverde

@SomeoneToIgnore I can confirm that your workaround fixes Astro as well.

shishkin avatar Oct 15 '24 16:10 shishkin

"language_servers": ["vue-language-server", "..."],

this worked for me

lamcc21 avatar Aug 25 '25 12:08 lamcc21