-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlsp.lua
More file actions
53 lines (49 loc) · 1.25 KB
/
lsp.lua
File metadata and controls
53 lines (49 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-- Create a table to store the configuration values
local val = {}
-- Require the 'lspconfig' module
local lspconfig = require("lspconfig")
-- Specify the language servers to be used, that don't need configuration
val.servers = {
"clangd",
"marksman",
"tailwindcss",
"tsserver",
"html",
"bashls",
"cssls",
"hls",
"rust_analyzer",
}
-- Setup the configuration for 'lua_ls' language server
lspconfig.lua_ls.setup({
-- Attach a custom on_attach function for the language server
on_attach = require("lsp-format").on_attach,
settings = {
Lua = {
completion = {
callSnippet = "Replace",
},
runtime = {
-- Specify the version of Lua being used (e.g., LuaJIT)
version = "LuaJIT",
},
diagnostics = {
-- Specify global variables for diagnostics (e.g., 'vim', 'require')
globals = {
"vim",
"require",
},
},
workspace = {
-- Include Neovim runtime files in the server's library
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
-- Disable sending telemetry data with a unique identifier
enable = false,
},
},
},
})
-- Return the 'val' table as the module value
return val