mirror of
https://github.com/neovim/neovim.git
synced 2025-11-03 09:14:24 +00:00
refactor(lsp): remove freeze() from gen_lsp (#29955)
To match the change in https://github.com/neovim/neovim/pull/29283
This commit is contained in:
committed by
GitHub
parent
5de2ae2bce
commit
0a0962a2e8
@@ -109,26 +109,8 @@ local function gen_methods(protocol)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
output[#output + 1] = '}'
|
output[#output + 1] = '}'
|
||||||
output = vim.list_extend(
|
output[#output + 1] = ''
|
||||||
output,
|
output[#output + 1] = 'return protocol'
|
||||||
vim.split(
|
|
||||||
[[
|
|
||||||
local function freeze(t)
|
|
||||||
return setmetatable({}, {
|
|
||||||
__index = t,
|
|
||||||
__newindex = function()
|
|
||||||
error('cannot modify immutable table')
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
protocol.Methods = freeze(protocol.Methods)
|
|
||||||
|
|
||||||
return protocol
|
|
||||||
]],
|
|
||||||
'\n',
|
|
||||||
{ trimempty = true }
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
local fname = './runtime/lua/vim/lsp/protocol.lua'
|
local fname = './runtime/lua/vim/lsp/protocol.lua'
|
||||||
local bufnr = vim.fn.bufadd(fname)
|
local bufnr = vim.fn.bufadd(fname)
|
||||||
|
|||||||
Reference in New Issue
Block a user