fix(lsp): deprecate vim.lsp.protocol.Methods (#35998)

This commit is contained in:
Maria Solano
2025-10-04 21:09:13 -07:00
committed by GitHub
parent 2f35221774
commit b938638d2d
23 changed files with 179 additions and 200 deletions

View File

@@ -211,7 +211,7 @@ describe('vim.lsp.diagnostic', function()
diagnosticProvider = {},
},
handlers = {
[vim.lsp.protocol.Methods.textDocument_diagnostic] = function(_, params)
['textDocument/diagnostic'] = function(_, params)
_G.params = params
_G.requests = _G.requests + 1
end,
@@ -421,7 +421,7 @@ describe('vim.lsp.diagnostic', function()
data = {},
message = '',
}, {}, {
method = vim.lsp.protocol.Methods.textDocument_diagnostic,
method = 'textDocument/diagnostic',
client_id = client_id,
bufnr = diagnostic_bufnr,
})
@@ -438,7 +438,7 @@ describe('vim.lsp.diagnostic', function()
data = { retriggerRequest = true },
message = '',
}, {}, {
method = vim.lsp.protocol.Methods.textDocument_diagnostic,
method = 'textDocument/diagnostic',
client_id = client_id,
bufnr = diagnostic_bufnr,
})
@@ -455,7 +455,7 @@ describe('vim.lsp.diagnostic', function()
data = { retriggerRequest = false },
message = '',
}, {}, {
method = vim.lsp.protocol.Methods.textDocument_diagnostic,
method = 'textDocument/diagnostic',
client_id = client_id,
bufnr = diagnostic_bufnr,
})
@@ -477,7 +477,7 @@ describe('vim.lsp.diagnostic', function()
_G.make_error('Pull Diagnostic', 4, 4, 4, 4),
},
}, {
method = vim.lsp.protocol.Methods.textDocument_diagnostic,
method = 'textDocument/diagnostic',
params = {
textDocument = { uri = fake_uri },
},
@@ -487,7 +487,7 @@ describe('vim.lsp.diagnostic', function()
vim.api.nvim_exec_autocmds('LspNotify', {
buffer = diagnostic_bufnr,
data = {
method = vim.lsp.protocol.Methods.textDocument_didChange,
method = 'textDocument/didChange',
client_id = client_id,
},
})
@@ -503,7 +503,7 @@ describe('vim.lsp.diagnostic', function()
kind = 'unchanged',
resultId = 'squidward',
}, {
method = vim.lsp.protocol.Methods.textDocument_diagnostic,
method = 'textDocument/diagnostic',
params = {
textDocument = { uri = fake_uri },
},
@@ -513,7 +513,7 @@ describe('vim.lsp.diagnostic', function()
vim.api.nvim_exec_autocmds('LspNotify', {
buffer = diagnostic_bufnr,
data = {
method = vim.lsp.protocol.Methods.textDocument_didChange,
method = 'textDocument/didChange',
client_id = client_id,
},
})
@@ -560,7 +560,7 @@ describe('vim.lsp.diagnostic', function()
vim.api.nvim_exec_autocmds('LspNotify', {
buffer = second_buf,
data = {
method = vim.lsp.protocol.Methods.textDocument_didChange,
method = 'textDocument/didChange',
client_id = client_id,
},
})