Skip to content

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

Closed
firu11 wants to merge 21 commits intozed-extensions:mainfrom
firu11:main
Closed

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

Conversation

@firu11
Copy link
Copy Markdown

@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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

cla-bot bot commented Jan 22, 2026

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

@hyperstown
Copy link
Copy Markdown

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
Copy Markdown
Author

firu11 commented Feb 24, 2026

I agree. This is just a temporary solution.

firu11 and others added 14 commits February 24, 2026 13:24
This PR updates the CI workflow files from the main Zed repository
based on the commit
zed-industries/zed@e439c29

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
just update readme for settings options

---------

Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
)

## Summary
Restrict the `@vue/typescript-plugin` `languages` list to only `vue.js`
when configuring `vtsls`.

## Problem
With the Vue extension enabled, TypeScript completion items were
duplicated in plain `.ts`/`.tsx` files (issue #72).

## Change
- Updated plugin config in `src/vue.rs`:
  - from: `["typescript", "vue.js"]`
  - to: `["vue.js"]`

This keeps Vue-specific behavior for Vue files while avoiding plugin
overlap in TypeScript files.

## Validation
- `cargo test` passes locally.

Fixes #72
This PR bumps the version of this extension to v0.3.1

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
This PR updates the CI workflow files from the main Zed repository
based on the commit
zed-industries/zed@0c49aaa

This changes the workflows to instead use a pinned version of the
workflows from the main repository.

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
This PR updates the CI workflow files from the main Zed repository
based on the commit
zed-industries/zed@3e7f2e3

This adds initial support for extensions not located at the root of the
repository.

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
This PR updates the CI workflow files from the main Zed repository
based on the commit
zed-industries/zed@30d3467

This includes some fixes to the upstream publishing review which help
the Zed team with publishing extension versions quicker 🎉

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
This changes the tree-sitter capture for Vue directive names (`v-if`,
`v-model`, `v-for`, etc.) from `@keyword` to `@keyword.directive`.


## Motivation

Currently, Vue directives like `v-if` and `v-model` are captured as
`@keyword`, making them visually identical to HTML attributes, not that
there's something wrong with that but because they're being captured as
`@keyword` it makes it impossible for themes to style them differently,
and they often need to style the attributes differently in order for the
directives be styled differently.

`@keyword.directive` is already used by other languages for similar
constructs (e.g., preprocessor directives). With this change, theme
authors can distinguish Vue template directives from language-level
keywords.

### Breaking changes?

None! Themes that don't define `keyword.directive` will fall back to
`keyword` styling, so this is a non-breaking change for existing themes.
The Vue language server crashes silently in Zed when providing attribute
completions. The crash originates in `@vue/language-service` at
`vue-template.js:604`, where the code uses:

```js
meta?.props.map(prop => [prop.name, prop]) ?? []
```

This throws a `TypeError: Cannot read properties of undefined (reading
'map')` when `meta` exists but `meta.props` is `undefined`. The safe
form would be `meta?.props?.map(...)`.

This bug was introduced upstream in
[vuejs/language-tools#5888](vuejs/language-tools#5888)
and affects `@vue/language-server` versions **3.2.2+**.

**Upstream issue:** vuejs/language-tools#5956

Pin `@vue/language-server` to version **3.2.1** (the last known working
version before the buggy change) instead of dynamically fetching the
latest version via `npm_package_latest_version`.

This is a temporary workaround. Once the upstream package publishes a
fix, the pin should be removed so users can receive future updates.

- Added a `PINNED_SERVER_VERSION` constant set to `"3.2.1"` with a
comment explaining the reason and linking to the upstream issue.
- Replaced `zed::npm_package_latest_version(PACKAGE_NAME)?` with
`PINNED_SERVER_VERSION.to_string()` in `server_script_path`.
- Added a `TODO` comment to remove the pin once upstream is fixed.

Fixes #92

Co-authored-by: theiter8r <theiter8r@users.noreply.github.com>
This PR bumps the version of this extension to v0.3.2

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
This PR updates the CI workflow files from the main Zed repository
based on the commit
zed-industries/zed@3183c04

The update includes a new version of the extension CLI which adds
validation for semantic token rules for languages

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
@firu11
Copy link
Copy Markdown
Author

firu11 commented Apr 12, 2026

I've just tested the main branch and it seems to work without this workaround. I'm closing this for now.

@firu11 firu11 closed this Apr 12, 2026
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.

9 participants