Skip to content

Add ability to specify non-default language server and package.json path via LSP settings vol.2#90

Open
firu11 wants to merge 8 commits intozed-extensions:mainfrom
firu11:main
Open

Add ability to specify non-default language server and package.json path via LSP settings vol.2#90
firu11 wants to merge 8 commits intozed-extensions:mainfrom
firu11:main

Conversation

@firu11
Copy link

@firu11 firu11 commented Jan 22, 2026

Building on top of #77 by @GamerGirlandCo

You can now specify the relative path to "vue-language-server" via settings.json like so:

An example project/dir structure:

foo-project
├── backend/
│   └── ...
├── frontend/
│   ├── package.json
│   ├── node_modules/
│   └── ...
└── ...

settings.json:

{
  // ...
  "lsp": {
    "vue-language-server": {
      "settings": {
        "server_path": "frontend/node_modules/@vue/language-server/bin/vue-language-server.js",
        "package_json_path": "frontend"
      }
    }
  },
  // ...
}

It tries to find the lsp in this order:

  1. from settings.json
  2. from the hardcoded SERVER_PATH aka. the root dir
  3. install from npm

I'm not a good rust programmer, please check the changes thoroughly. Thanks! 😅

@cla-bot
Copy link

cla-bot bot commented Jan 22, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @firu11 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@firu11
Copy link
Author

firu11 commented Jan 22, 2026

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Jan 22, 2026
@cla-bot
Copy link

cla-bot bot commented Jan 22, 2026

The cla-bot has been summoned, and re-checked this pull request!

@hyperstown
Copy link

While manually specifying lsp working dir could be useful and that's how it was done back in the day eg in vetur:
vetur.config.js

module.exports = {
  projects: [
    {
      root: './src/frontend/', //root of subproject
      package: './package.json', // It is relative to root property.
    }
  ]
}

Currently most common approach would be to just use root markers.
LSP server scans recursively directories and looks for patterns like package.json, nuxt.config.js, vite.config.js, src/*vue.
That's how lspconfig works in nvim and how lsp servers work in vscode.
I guess that #91 shouldn't be closed unless we have proper root markers implementation.

@firu11
Copy link
Author

firu11 commented Feb 24, 2026

I agree. This is just a temporary solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants