vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.55k stars 373 forks source link

Nvim, can not jump file. #4427

Closed iamxiaojianzheng closed 3 weeks ago

iamxiaojianzheng commented 3 weeks ago

Excuse me, when I use nvim in vue, I cannot jump to the test.js file in "@/api/test.js" through the gf function provided by lsp.

However, such a path as "./modules/test.vue" can be jumped normally.

I have installed vue-language-server through Mason.

Do I need to do additional configuration for @?

iamxiaojianzheng commented 3 weeks ago

I'm not sure if it's caused by this configuration.

Added the baseUrl and paths properties under compilerOptions in jsconfig.json, as shown below.

{
  "compilerOptions": {
    "resolveJsonModule": false,
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  },
  "include": [
    "./src/**/*",
    "./server/**/*",
    "./mock/**/*",
    "./config/**/*",
    "./babel.config.js",
    "./vue.config.js"
  ],
  "extends": ["node_modules"]
}

Then jump is ok.