File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1
1
local util = require ' lspconfig.util'
2
2
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
+
3
16
return {
4
17
default_config = {
5
18
cmd = { ' svelteserver' , ' --stdio' },
6
19
filetypes = { ' svelte' },
7
20
root_dir = util .root_pattern (' package.json' , ' .git' ),
8
21
},
22
+ commands = {
23
+ MigrateToSvelte5 = {
24
+ migrate_to_svelte_5 ,
25
+ description = ' Migrate Component to Svelte 5 Syntax' ,
26
+ },
27
+ },
9
28
docs = {
10
29
description = [[
11
30
https://github.com/sveltejs/language-tools/tree/master/packages/language-server
You can’t perform that action at this time.
0 commit comments