aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/semantic_tokens.lua
diff options
context:
space:
mode:
authorRaphael <glephunter@gmail.com>2023-08-03 19:03:48 +0800
committerGitHub <noreply@github.com>2023-08-03 04:03:48 -0700
commitf1772272b4fda43c093fc495f54b5e7c11968d62 (patch)
treeaca0ec70aec49ea58b651759c5821c5a0aacd07a /runtime/lua/vim/lsp/semantic_tokens.lua
parent214b125132778c5d51d4d7e673d31a9be835e150 (diff)
downloadrneovim-f1772272b4fda43c093fc495f54b5e7c11968d62.tar.gz
rneovim-f1772272b4fda43c093fc495f54b5e7c11968d62.tar.bz2
rneovim-f1772272b4fda43c093fc495f54b5e7c11968d62.zip
refactor(lsp): use protocol.Methods instead of strings #24537
Diffstat (limited to 'runtime/lua/vim/lsp/semantic_tokens.lua')
-rw-r--r--runtime/lua/vim/lsp/semantic_tokens.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua
index 84723bbc05..bab1b23ee4 100644
--- a/runtime/lua/vim/lsp/semantic_tokens.lua
+++ b/runtime/lua/vim/lsp/semantic_tokens.lua
@@ -1,6 +1,7 @@
local api = vim.api
local bit = require('bit')
local handlers = require('vim.lsp.handlers')
+local ms = require('vim.lsp.protocol').Methods
local util = require('vim.lsp.util')
local uv = vim.uv
@@ -292,7 +293,7 @@ function STHighlighter:send_request()
local hasEditProvider = type(spec) == 'table' and spec.delta
local params = { textDocument = util.make_text_document_params(self.bufnr) }
- local method = 'textDocument/semanticTokens/full'
+ local method = ms.textDocument_semanticTokens_full
if hasEditProvider and current_result.result_id then
method = method .. '/delta'
@@ -755,7 +756,7 @@ end
--- the BufWinEnter event should take care of it next time it's displayed.
---
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#semanticTokens_refreshRequest
-handlers['workspace/semanticTokens/refresh'] = function(err, _, ctx)
+handlers[ms.workspace_semanticTokens_refresh] = function(err, _, ctx)
if err then
return vim.NIL
end