Meh I'll figure out submodules later

This commit is contained in:
mustard 2025-09-16 01:01:02 +02:00
parent 4ca9d44a90
commit 8cb281f436
352 changed files with 66107 additions and 0 deletions

View file

@ -0,0 +1,30 @@
local vim = vim
local M = {}
M._original_functions = {}
--- Override an lsp method default callback
--- @param method string
--- @param new_function function
function M.override(method, new_function)
if M._original_functions[method] == nil then
M._original_functions[method] = vim.lsp.callbacks[method]
end
vim.lsp.callbacks[method] = new_function
end
--- Get the original method callback
--- useful if you only want to override in some circumstances
---
--- @param method string
function M.get_original_function(method)
if M._original_functions[method] == nil then
M._original_functions[method] = vim.lsp.callbacks[method]
end
return M._original_functions[method]
end
return M