-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use latest available @vue/language-server package #1
Conversation
Copied from: zed-industries/zed#18807 (comment) Authored by @rowanwins
By the way, can someone put it in beta to check it out? |
Is there anything additional required for this PR to move forward ? |
@April-Gras maybe do friendly ping developers? |
My comments from the original PR still haven't been addressed:
We need to do thorough testing of this, particularly with TypeScript, and make sure that it works as expected. |
Out of curiosity, when building Zed from source, what do I have to do to test this PR? Would love to give it a shot in a Vue-based codebase with Typescript scripts (setup syntax) and SCSS scoped styles |
Whether you're building Zed from source or using a pre-built version, the steps are the same. You just need to install it as a dev extension following the instructions here: https://zed.dev/docs/extensions/developing-extensions#developing-an-extension-locally |
From my testing, just using the latest version didn't work out. I didn't get any language server features inside typescript blocks. But I also didn't get any telling language server errors or logs, so no idea why this didn't seem to work. |
I get this error:
|
Could you share more details please? What version zed you are running, OS, the exact steps you took to install the extension from this PR. Are you sure you were checked out to this PR exactly? Does this error occur during the downloading of the server? |
|
We require contributors to sign our Contributor License Agreement, and we don't have @April-Gras on file. You can sign our CLA at https://zed.dev/cla. Normally this would've been handled by Thanks. |
This issue still persists. The extension works for vue template but not for any code inside the script tag. It does show the correct highlighting though. They have it set up so that the autocomplete for the script tag is now handled by typescript-language-server or tsserver but you have to add @vue/typescript-plugin to it. Is this something you can do @April-Gras . I've been tinkering with it but haven't been able to do it yet |
someone can take care of it? I so don't want to go back to vscode. |
I'd love to help out with this effort also. It does appear that the vscode extension essentially delegates its functionality to a plugin for the TypeScript extension. It looks like it does some funky monkey-patching of I'm not familiar with the zed extensions architecture but is there a way for the Vue extension to add a plugin to the TS language server? |
Would it be possible to init the extension with I understand that this would be like the old behavior and use the embedded ts server for version >= 2.0.7 |
I think it's |
last year's issue :)) |
I have done some local tests, it works perfectly when disabling Here is what I changed:
let version = "2.2.0".to_string();
if !server_exists
|| zed::npm_package_installed_version(PACKAGE_NAME)?.as_ref() != Some(&version)
{
fn language_server_initialization_options(
&mut self,
_language_server_id: &zed::LanguageServerId,
_worktree: &zed::Worktree,
) -> Result<Option<serde_json::Value>> {
Ok(Some(serde_json::json!({
"typescript": {
"tsdk": self.typescript_tsdk_path
},
"vue": {
"hybridMode": false,
}
})))
} ![]() |
credits go to @0x-jerry (https://github.com/0x-jerry) source is zed-extensions#1 (comment)
We require contributors to sign our Contributor License Agreement, and we don't have @April-Gras 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'. |
Thank you so much @0x-jerry 🙏 Screencast.from.2025-01-19.10-36-06.mp4 |
Any reason why it was left pinned to 2.2.0 instead of using the latest available version? |
It works with latest on my machine but I would assume @0x-jerry had a reason ? |
I think pinning the version will make the extension more stable. This ensures that it will not break the extension even if |
Sounds fair tbh 🤝 |
Same here ^^ |
Thanks, last changes are an improvement. However, I think I found an issue. In What I had to do is:
[language_servers.vue-language-server]
name = "Vue Language Server"
# language = "Vue.js"
languages = ["Vue.js", "TypeScript"]
language_ids = { "Vue.js" = "vue", "TypeScript" = "typescript" } ##prob also add js?
# REFACTOR is explicitly disabled, as vue-lsp does not adhere to LSP protocol for code actions with these - it
# sends back a CodeAction with neither `command` nor `edits` fields set, which is against the spec.
code_action_kinds = ["", "quickfix", "refactor.rewrite"]
"TypeScript": {
"prettier": { "allowed": false },
"language_servers": ["vue-language-server", "!vtsls"]
} |
Been using this branch + the from @jl4nz suggested changes the entire day at work, and did not find a single issue so far! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you to everyone for testing this out!
This PR removes the outdated note about pinning `@vue/language-server` to v1.8. As of zed-extensions/vue#1 we now use the latest available version. Release Notes: - N/A
Copied from:
zed-industries/zed#18807 (comment):
Originaly Authored by @rowanwins