refactor(lsp): change capability name to snake case

This commit is contained in:
Yi Ming
2025-07-21 13:02:19 +08:00
parent 7c3e579a90
commit a37e101dc7
3 changed files with 5 additions and 6 deletions

View File

@@ -54,10 +54,9 @@ function M:new(bufnr)
---@type vim.lsp.Capability ---@type vim.lsp.Capability
self = setmetatable({}, Class) self = setmetatable({}, Class)
self.bufnr = bufnr self.bufnr = bufnr
self.augroup = api.nvim_create_augroup( self.augroup = api.nvim_create_augroup(string.format('nvim.lsp.%s:%s', self.name, bufnr), {
string.format('nvim.lsp.%s:%s', self.name:gsub('%s+', '_'):lower(), bufnr), clear = true,
{ clear = true } })
)
self.client_state = {} self.client_state = {}
api.nvim_create_autocmd('LspDetach', { api.nvim_create_autocmd('LspDetach', {

View File

@@ -35,7 +35,7 @@ local Capability = require('vim.lsp._capability')
--- ---
--- Index in the form of start_row -> collapsed_text --- Index in the form of start_row -> collapsed_text
---@field row_text table<integer, string?> ---@field row_text table<integer, string?>
local State = { name = 'Folding Range', active = {} } local State = { name = 'folding_range', active = {} }
State.__index = State State.__index = State
setmetatable(State, Capability) setmetatable(State, Capability)

View File

@@ -41,7 +41,7 @@ local M = {}
---@field debounce integer milliseconds to debounce requests for new tokens ---@field debounce integer milliseconds to debounce requests for new tokens
---@field timer table uv_timer for debouncing requests for new tokens ---@field timer table uv_timer for debouncing requests for new tokens
---@field client_state table<integer, STClientState> ---@field client_state table<integer, STClientState>
local STHighlighter = { name = 'Semantic Tokens', active = {} } local STHighlighter = { name = 'semantic_tokens', active = {} }
STHighlighter.__index = STHighlighter STHighlighter.__index = STHighlighter
setmetatable(STHighlighter, Capability) setmetatable(STHighlighter, Capability)