This repository was archived by the owner on Feb 28, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlua_ls.lua
More file actions
54 lines (52 loc) · 1.3 KB
/
Copy pathlua_ls.lua
File metadata and controls
54 lines (52 loc) · 1.3 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
54
---@type vim.lsp.Config
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = {
'.luacheckrc',
'.stylua.toml',
'stylua.toml',
'selene.toml',
'selene.yml',
'.emmyrc.json',
'.luarc.json',
'.luarc.jsonc',
'.git',
},
on_init = function(client)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
path ~= vim.fn.stdpath 'config'
and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc'))
then
return
end
end
---@diagnostic disable-next-line: param-type-mismatch
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
version = 'LuaJIT',
path = {
'lua/?.lua',
'lua/?/init.lua',
},
},
workspace = {
checkThirdParty = false,
library = vim.api.nvim_get_runtime_file('', true),
},
telemetry = {
enable = false,
},
})
end,
settings = {
Lua = {
codeLens = { enable = true },
hint = { enable = true, semicolon = 'Disable' },
},
},
}