Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When import .vue file Ctrl + Click can not jump to the definition #2052

Closed
CheIIau opened this issue Oct 23, 2022 · 14 comments
Closed

When import .vue file Ctrl + Click can not jump to the definition #2052

CheIIau opened this issue Oct 23, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@CheIIau
Copy link

CheIIau commented Oct 23, 2022

When import .vue file, Ctrl + Click can not jump to the definition anymore, and the path intellisense can not find .vue file too.

Howerver, it works in v0.40.13 and before.

behavior in v0.40.13:
2022-10-23 19-26-12

behavior after v0.40.13:
2022-10-23 19-24-22

Actually, there was an issue similar to this before
#435
The problem seems to be back

@mikehaertl
Copy link

I see a similar issue in neovim after upgrading to 1.x but it affects more:

Filetypes (using take-over mode): typescript, js and vue

Methods: Hover, goto definition, code actions.

Neovim gives me:

  • method textDocument/definition is not supported by any of the servers registered for the current buffer
  • method textDocument/hover is not supported by any of the servers registered for the current buffer
  • method textDocument/codeAction is not supported by any of the servers registered for the current buffer

@Cgboal
Copy link

Cgboal commented Nov 1, 2022

I'm getting the same with neovim.

@KarmaBlackshaw
Copy link

I am having the same issue.

Here's what the Vue Semantic Server is logging. I'm not sure if its related tho

  - c:/Users/Administrator/.vscode/extensions/ms-vscode.vscode-typescript-next-5.0.20221103/node_modules/typescript/lib/lib.dom.d.ts
    size: 816717
    ref counts: "2|5|true|1|false|undefined|undefined|j:/outliant/sunrise/dashboard|{@/*: [./src/*]}|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|undefined|2|undefined|j:/,)"

And here's my jsconfig

{
  "compilerOptions": {
    "baseUrl": ".",
    "module": "es6",
    "target": "es6",
    "jsx": "preserve",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "exclude": ["node_modules", "dist"],
  "vueCompilerOptions": {
    "target": 2.7,
    "jsx": "preserve"
  }
}

@johnsoncodehk
Copy link
Member

@CheIIau could you try can this problem reproduce in https://github.com/johnsoncodehk/volar-starter?

@CheIIau
Copy link
Author

CheIIau commented Nov 28, 2022

@johnsoncodehk hm, on volar-starter repository it seems to work properly. then i don't understand why it doesn't work in my project. i noticed that if you import file using path like '../../bar.vue' you can jump to the definition and everything works. but if you import your vue file using ts alias like 'src/components/bar.vue' it doesn't work. but again everything workes in my project on volar v0.40.13 and older versions. can't tell exactly why is it happening. please, write if you need more info

my ts config:

{
  "extends": "@quasar/app-vite/tsconfig-preset",
  "compilerOptions": {
    "useUnknownInCatchVariables": false,
    "baseUrl": ".",
    "paths": {
      "src/*": [
        "src/*"
      ],
      "app/*": [
        "*"
      ],
      "components/*": [
        "src/components/*"
      ],
    }
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.d.ts",
    "src/**/*.tsx",
    "src/**/*.vue"
  ]
}

@CheIIau
Copy link
Author

CheIIau commented Dec 8, 2022

i noticed that problem occurs in quasar projects, even in a just created one (default and clean). i created them with quasar cli. in default vue project everything works fine. it seems to be some kind of conflict between quasar and volar, idk. but it's strange that everything works properly on v0.40.13 and below.

@johnsoncodehk
Copy link
Member

Unfortunately I can't reproduce the problem even use your tsconfig, what's your OS?

If you can provide minimal reproduction or create a test case to https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-test-workspace/find-definition it will be very helpful.

@CheIIau
Copy link
Author

CheIIau commented Dec 9, 2022

i tried it on windows 11 and 7

@johnsoncodehk
Copy link
Member

I fixed a bug that most likely caused this issue, please let me know if it still doesn't work in the next version.

@johnsoncodehk johnsoncodehk added bug Something isn't working and removed need info labels Dec 16, 2022
@CheIIau
Copy link
Author

CheIIau commented Dec 18, 2022

No, I still facing the bug. I noticed that it only happens if you use "export default defineComponent({})", not script setup. With script setup all seems to be fine. And the problem even appears for me in your volar-starter project, when i changed script setup to usual script with export default defineComponent in HelloWorld component. I didn't notice this before because I didn't think it could be the case and didn't try to change it for export default.

@hymair
Copy link

hymair commented Jan 6, 2023

Facing the exact same issue in a Vue 2.7 project. @johnsoncodehk please re-open.

@tanpengsccd
Copy link

got same error Volar 1.2.0 with vue: ^3.2.45

@johnsoncodehk
Copy link
Member

This issue is obsolete, if it reappears it is probably for a different reason, please open a new issue and provide a repro case.

@oshliaer
Copy link

#4063 can be a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants