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

Update Volar (currently called Vue Language Tools) to v2.0 #728

Merged
merged 6 commits into from
Mar 19, 2024

Conversation

tsukkee
Copy link
Contributor

@tsukkee tsukkee commented Mar 12, 2024

Vue Language Tools v2.0 consists of the @vue/language-server and @vue/typescript-plugin.

  • Add g:lsp_settings_filetype_vue setup instruction to enable both volar-server and typescript-language-server in vue filetype.
  • Add @vue/typescript-plugin to typescript-language-server plugins only in Vue projects.
  • Show warnings when the setup is incomplete.

I think this is the first case to utilize typescript language server's plugins in vue-lsp-setttings.
So, I would like to have advice if my approach to do that is not appropriate.

@@ -1,3 +1,38 @@
function! s:find_vue_plugin() abort
let package_json_path = lsp#utils#find_nearest_parent_file(lsp#utils#get_buffer_path(), 'package.json')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ask]
What happens if there is vue in the root package.json In monorepo?
It would be nice if users could inject the location of package.json(global variable or can get from lsp_settings#get()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback! I couldn't consider that…
What I want to do is enabling @vue/typescript-plugin only in Vue projects, but I don't come up with an idea to detect Vue projects even in monorepo situation 🤔
Now I'm wondering if @vue/typescript-plugin is always enabled when it exists, since it doesn't have bad side effects (might have small performance degradation, though).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified to use @vue/typescript-plugin when it just exists 983dc16 .

I think that this still has small side effect to all users since only Vue users will install volar-server.

@mattn
Copy link
Owner

mattn commented Mar 14, 2024

@heavenshell any opinion?

@heavenshell
Copy link
Contributor

@mattn I'm sorry did not notice your mention.
LGTM!

@mattn mattn merged commit d076647 into mattn:master Mar 19, 2024
14 checks passed
@mattn
Copy link
Owner

mattn commented Mar 19, 2024

Thank you

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.

3 participants