Skip to content

Commit 47e5ba8

Browse files
authored
ref: updates function signature for vim.lsp.handlers[handler] to remove config (#31)
- Should not break any existing overrides since config is last parameter and is unused
1 parent 3bd23c4 commit 47e5ba8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ If you want to override `tsserver`'s `textDocument/publishDiagnostics` handler
6060
then use to override your lsp handlers. Here is example usage:
6161

6262
```lua
63-
vim.lsp.handlers["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
64-
require("ts-error-translator").translate_diagnostics(err, result, ctx, config)
65-
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
63+
vim.lsp.handlers["textDocument/publishDiagnostics"] = function(err, result, ctx)
64+
require("ts-error-translator").translate_diagnostics(err, result, ctx)
65+
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx)
6666
end
6767
```
6868

lua/ts-error-translator/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ end
155155
-- @param result any: The diagnostics result object.
156156
-- @param ctx lsp.HandlerContext: The context object containing LSP client information.
157157
-- @param _ Unused parameter.
158-
M.translate_diagnostics = function(_, result, ctx, _)
158+
M.translate_diagnostics = function(_, result, ctx)
159159
local client_name = get_lsp_client_name_by_id(ctx.client_id)
160160

161161
if vim.tbl_contains(supported_servers, client_name) then

0 commit comments

Comments
 (0)