mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
refactor: use nvim.foo.bar format for autocommand groups
This commit is contained in:
@@ -171,7 +171,7 @@ end
|
||||
-- 1. Implement clearing `bufstate` and event hooks
|
||||
-- when no clients in the buffer support the corresponding method.
|
||||
-- 2. Then generalize this state management to other LSP modules.
|
||||
local augroup_setup = api.nvim_create_augroup('vim_lsp_folding_range/setup', {})
|
||||
local augroup_setup = api.nvim_create_augroup('nvim.lsp.folding_range.setup', {})
|
||||
|
||||
--- Initialize `bufstate` and event hooks, then request folding ranges.
|
||||
--- Manage their lifecycle within this function.
|
||||
|
||||
@@ -30,7 +30,7 @@ local namespaces = setmetatable({}, {
|
||||
---@private
|
||||
M.__namespaces = namespaces
|
||||
|
||||
local augroup = api.nvim_create_augroup('vim_lsp_codelens', {})
|
||||
local augroup = api.nvim_create_augroup('nvim.lsp.codelens', {})
|
||||
|
||||
api.nvim_create_autocmd('LspDetach', {
|
||||
group = augroup,
|
||||
|
||||
@@ -630,7 +630,7 @@ local function enable_completions(client_id, bufnr, opts)
|
||||
|
||||
-- Set up autocommands.
|
||||
local group =
|
||||
api.nvim_create_augroup(string.format('vim/lsp/completion-%d', bufnr), { clear = true })
|
||||
api.nvim_create_augroup(string.format('nvim.lsp.completion_%d', bufnr), { clear = true })
|
||||
api.nvim_create_autocmd('CompleteDone', {
|
||||
group = group,
|
||||
buffer = bufnr,
|
||||
|
||||
@@ -5,7 +5,7 @@ local api = vim.api
|
||||
|
||||
local M = {}
|
||||
|
||||
local augroup = api.nvim_create_augroup('vim_lsp_diagnostic', {})
|
||||
local augroup = api.nvim_create_augroup('nvim.lsp.diagnostic', {})
|
||||
|
||||
local DEFAULT_CLIENT_ID = -1
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ local bufstates = vim.defaulttable(function(_)
|
||||
end)
|
||||
|
||||
local namespace = api.nvim_create_namespace('nvim.lsp.inlayhint')
|
||||
local augroup = api.nvim_create_augroup('vim_lsp_inlayhint', {})
|
||||
local augroup = api.nvim_create_augroup('nvim.lsp.inlayhint', {})
|
||||
|
||||
--- |lsp-handler| for the method `textDocument/inlayHint`
|
||||
--- Store hints for a specific buffer and client
|
||||
|
||||
@@ -166,7 +166,7 @@ function STHighlighter.new(bufnr)
|
||||
local self = setmetatable({}, { __index = STHighlighter })
|
||||
|
||||
self.bufnr = bufnr
|
||||
self.augroup = api.nvim_create_augroup('vim_lsp_semantic_tokens:' .. bufnr, { clear = true })
|
||||
self.augroup = api.nvim_create_augroup('nvim.lsp.semantic_tokens:' .. bufnr, { clear = true })
|
||||
self.client_state = {}
|
||||
|
||||
STHighlighter.active[bufnr] = self
|
||||
|
||||
@@ -1357,7 +1357,7 @@ end
|
||||
---@param bufnrs table list of buffers where the preview window will remain visible
|
||||
---@see autocmd-events
|
||||
local function close_preview_autocmd(events, winnr, bufnrs)
|
||||
local augroup = api.nvim_create_augroup('preview_window_' .. winnr, {
|
||||
local augroup = api.nvim_create_augroup('nvim.preview_window_' .. winnr, {
|
||||
clear = true,
|
||||
})
|
||||
|
||||
@@ -1619,7 +1619,7 @@ function M.open_floating_preview(contents, syntax, opts)
|
||||
api.nvim_buf_set_var(bufnr, 'lsp_floating_preview', floating_winnr)
|
||||
end
|
||||
|
||||
local augroup_name = ('closing_floating_preview_%d'):format(floating_winnr)
|
||||
local augroup_name = ('nvim.closing_floating_preview_%d'):format(floating_winnr)
|
||||
local ok =
|
||||
pcall(api.nvim_get_autocmds, { group = augroup_name, pattern = tostring(floating_winnr) })
|
||||
if not ok then
|
||||
|
||||
Reference in New Issue
Block a user