+1
-4
lsp/gopls.lua
+1
-4
lsp/gopls.lua
-1
lsp/lua_ls.lua
-1
lsp/lua_ls.lua
-7
lsp/markdown_oxide.lua
-7
lsp/markdown_oxide.lua
+1
-27
lsp/ts_ls.lua
+1
-27
lsp/ts_ls.lua
···
2
2
return {
3
3
cmd = { "typescript-language-server", "--stdio" },
4
4
init_options = { hostInfo = "neovim" },
5
+
root_markers = { "tsconfig.json", "jsconfig.json", "package.json" },
5
6
filetypes = {
6
7
"javascript",
7
8
"javascriptreact",
···
9
10
"typescript",
10
11
"typescriptreact",
11
12
"typescript.tsx",
12
-
},
13
-
root_markers = {
14
-
"node_modules",
15
-
"tsconfig.json",
16
-
"jsconfig.json",
17
-
"package.json",
18
13
},
19
14
handlers = {
20
15
-- handle rename request for certain code actions like extracting functions / types
···
31
26
return vim.NIL
32
27
end,
33
28
},
34
-
35
-
on_attach = function(client)
36
-
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
37
-
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
38
-
vim.api.nvim_buf_create_user_command(
39
-
0,
40
-
"LspTypescriptSourceAction",
41
-
function()
42
-
local source_actions = vim.tbl_filter(function(action)
43
-
return vim.startswith(action, "source.")
44
-
end, client.server_capabilities.codeActionProvider.codeActionKinds)
45
-
46
-
vim.lsp.buf.code_action {
47
-
context = {
48
-
only = source_actions,
49
-
},
50
-
}
51
-
end,
52
-
{}
53
-
)
54
-
end,
55
29
}
-9
lua/core/utils.lua
-9
lua/core/utils.lua
···
25
25
return require("blink.cmp").get_lsp_capabilities(extend or {})
26
26
end,
27
27
28
-
---@param bufnr integer
29
-
---@param name string
30
-
---@param command lsp.ExecuteCommandParams
31
-
command = function(bufnr, name, command)
32
-
vim.api.nvim_buf_create_user_command(bufnr, name, function()
33
-
vim.lsp.buf.execute_command(command)
34
-
end, {})
35
-
end,
36
-
37
28
---get list of lsp servers connected to current buffer
38
29
---@return string[]
39
30
get_clients = function()