commit a37e101dc76232483f5aa6bfc1087b4fff6950d2
parent 7c3e579a907e3d27caa6dfe67f0f4a6009f94609
Author: Yi Ming <ofseed@foxmail.com>
Date: Mon, 21 Jul 2025 13:02:19 +0800
refactor(lsp): change capability name to snake case
Diffstat:
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/runtime/lua/vim/lsp/_capability.lua b/runtime/lua/vim/lsp/_capability.lua
@@ -54,10 +54,9 @@ function M:new(bufnr)
---@type vim.lsp.Capability
self = setmetatable({}, Class)
self.bufnr = bufnr
- self.augroup = api.nvim_create_augroup(
- string.format('nvim.lsp.%s:%s', self.name:gsub('%s+', '_'):lower(), bufnr),
- { clear = true }
- )
+ self.augroup = api.nvim_create_augroup(string.format('nvim.lsp.%s:%s', self.name, bufnr), {
+ clear = true,
+ })
self.client_state = {}
api.nvim_create_autocmd('LspDetach', {
diff --git a/runtime/lua/vim/lsp/_folding_range.lua b/runtime/lua/vim/lsp/_folding_range.lua
@@ -35,7 +35,7 @@ local Capability = require('vim.lsp._capability')
---
--- Index in the form of start_row -> collapsed_text
---@field row_text table<integer, string?>
-local State = { name = 'Folding Range', active = {} }
+local State = { name = 'folding_range', active = {} }
State.__index = State
setmetatable(State, Capability)
diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua
@@ -41,7 +41,7 @@ local M = {}
---@field debounce integer milliseconds to debounce requests for new tokens
---@field timer table uv_timer for debouncing requests for new tokens
---@field client_state table<integer, STClientState>
-local STHighlighter = { name = 'Semantic Tokens', active = {} }
+local STHighlighter = { name = 'semantic_tokens', active = {} }
STHighlighter.__index = STHighlighter
setmetatable(STHighlighter, Capability)