Skip to content

Commit 202a7ca

Browse files
committed
feat(svelte): command to migrate to svelte 5
1 parent 84e0cd5 commit 202a7ca

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lua/lspconfig/configs/svelte.lua

+19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
local util = require 'lspconfig.util'
22

3+
local function migrate_to_svelte_5()
4+
local clients = vim.lsp.get_clients({
5+
bufnr = vim.api.nvim_get_current_buf(),
6+
name = 'svelte',
7+
})
8+
for _, client in ipairs(clients) do
9+
client:exec_cmd({
10+
command = 'migrate_to_svelte_5',
11+
arguments = { vim.uri_from_bufnr(0) },
12+
})
13+
end
14+
end
15+
316
return {
417
default_config = {
518
cmd = { 'svelteserver', '--stdio' },
619
filetypes = { 'svelte' },
720
root_dir = util.root_pattern('package.json', '.git'),
821
},
22+
commands = {
23+
MigrateToSvelte5 = {
24+
migrate_to_svelte_5,
25+
description = 'Migrate Component to Svelte 5 Syntax',
26+
},
27+
},
928
docs = {
1029
description = [[
1130
https://github.com/sveltejs/language-tools/tree/master/packages/language-server

0 commit comments

Comments
 (0)