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

Add @vue/typescript-plugin #5064

Closed
mcchrish opened this issue Mar 21, 2024 · 2 comments
Closed

Add @vue/typescript-plugin #5064

mcchrish opened this issue Mar 21, 2024 · 2 comments

Comments

@mcchrish
Copy link

mcchrish commented Mar 21, 2024

Starting Volar v2.0, it is now recommended to setup LSP as a typescript-plugin. Depending on your setup, tsserver or typescript-tools.nvim, you may need to install the plugin globally or as a dependency in the project. To give more flexibility on these options, it would be nice to allow installing this plugin via Mason.

https://github.com/vuejs/language-tools/tree/master/packages/typescript-plugin

Tracking issue where everyone is figuring out how to set it up properly: vuejs/language-tools#3925

Related issues:

@RayGuo-ergou
Copy link

RayGuo-ergou commented Mar 22, 2024

You don't need @vue/typescript-plugin installed, you can just use @vue/language-server's location. See: vuejs/language-tools#3925 (comment)

@mcchrish
Copy link
Author

Thanks! Probably directing to the same path as the installed vue-language-server is the more stable option to keep both versions the same. Here's my config for vtsls.

lspconfig.vtsls.setup {
	filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
	capabilities = capabilities,
	settings = {
		vtsls = {
			tsserver = {
				globalPlugins = {
					{
						name = "@vue/typescript-plugin",
						location = require("mason-registry")
							.get_package("vue-language-server")
							:get_install_path() .. "/node_modules/@vue/language-server",
						languages = { "vue" },
						configNamespace = "typescript",
						enableForWorkspaceTypeScriptVersions = true,
					},
				},
			},
		},
	},
}

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

No branches or pull requests

2 participants