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

feat: reintroducing the complete language server #4119

Merged
merged 11 commits into from
Mar 20, 2024
Merged

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Mar 19, 2024

closes #3942, closes #3962

We migrated to the TS plugin in 2.0 to resolve many issues with v1, unfortunately it had many issues with compatibility:

  • VSCode <= 1.87 bundled Node version breaks tsserver + @vue/typescript-plugin in some environments.
  • Even if @vue/typescript-plugin only provides vue virtual code and handles mapping, it still causes performance problems in tsserver in some TS versions.
  • Whenever any TS plugin crashes in a .vue file, it will cause @vue/typescript-plugin to be invalidated and make intellisense completely wrong. This is a fault-tolerance problem of the TS LS plugin architecture.

These issues are beyond our control, so we reintroduced the v1 complete LSP server and only switched to Hybrid Mode when explicitly enabled by the user.

@johnsoncodehk johnsoncodehk marked this pull request as ready for review March 20, 2024 01:38
@johnsoncodehk johnsoncodehk merged commit 3758474 into master Mar 20, 2024
6 checks passed
@johnsoncodehk johnsoncodehk deleted the full-lsp-server branch March 20, 2024 01:41
@altrusl
Copy link

altrusl commented Mar 20, 2024

@johnsoncodehk

That was a hard time
Thank you for your work

@Stanzilla
Copy link

So what's the recommended setup for TypeScript users now? Do we need the extra VSC extension again?

@so1ve
Copy link
Member

so1ve commented Mar 21, 2024

@Stanzilla No, you only need the Vue - Official plugin.

@Stanzilla
Copy link

@Stanzilla No, you only need the Vue - Official plugin.

And Hybrid Mode enabled, right? Would make more sense if this was called something like enable TypeScript support maybe?

@so1ve
Copy link
Member

so1ve commented Mar 21, 2024

And Hybrid Mode enabled, right? Would make more sense if this was called something like enable TypeScript support maybe?

If you have TS 5.3+ installed and have a tsconfig.json or jsconfig.json, feel free to enable it.

if this was called something like enable TypeScript support maybe

Not exact. "Hybrid Mode" means Vue Language Tools makes the built-in TS service to run on .vue files, and if you disable hybrid mode we a two separate TS language server on .vue files.

@gegoune
Copy link

gegoune commented Mar 21, 2024

Would be very helpful to have a comparison table of two solutions/approaches. Not being much experienced in tooling for JS I struggle to see how to chose what to do, enable hybrid mode? Disable it? What are the benefits of each approach? Downsides?

@johnsoncodehk johnsoncodehk mentioned this pull request Mar 21, 2024
@Stanzilla
Copy link

Would be very helpful to have a comparison table of two solutions/approaches. Not being much experienced in tooling for JS I struggle to see how to chose what to do, enable hybrid mode? Disable it? What are the benefits of each approach? Downsides?

Yes exactly, it's very unclear atm

folke pushed a commit to LazyVim/LazyVim that referenced this pull request Jul 5, 2024
…ame time (#3908)

## What is this PR for?

At the moment, the config for vue set hybrid mode to `false` which volar
will run a typescript server under the hook. ( hybrid mode false is the
takeover mode in v1, was introduced in `2.0.7` see more information
here: vuejs/language-tools#4119 ).

However, another vtsls with vue language plugin also attached to vue
files, this will cause two typescript server running at the same time.
It can be very easily observed with tools like `htop` volar and vtsls
will have similar memory usage which is abnormal because volar should be
very light by itself. This will introduce issues like duplicate
diagnostics, see
vuejs/language-tools#4159 (comment)

In this pull request, I set the hybrid mode to true as default because
the hybrid mode is the "correct" way moving forward, thus it would be
more stable. Let me know if you feel it should stay as `false` to be
default.

## Does this PR fix an existing issue?

No existing issue.

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
@vidal7
Copy link

vidal7 commented Jul 30, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vue server still crashed after upgrading to v2.0.4 in VSCode + Nuxt 3 False positive errors at end-of-file
6 participants