Skip to content

Commit 4f81701

Browse files
committed
feat: add toggling of inline_completion feature in Neovim
1 parent abdfb7a commit 4f81701

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ local opts = {
5252
features = {
5353
codelens = true, -- enable/disable codelens refresh on start
5454
inlay_hints = false, -- enable/disable inlay hints on start
55+
inline_completion = false, -- enable/disable inline completion capabilities (Neovim v0.12+ ONLY)
56+
linked_editing_range = false, -- enable/disable linked editing range capabilities (Neovim v0.12+ ONLY)
5557
semantic_tokens = true, -- enable/disable semantic token highlighting
58+
signature_help = false, -- enable/disable automatic signature help
5659
},
5760
-- Configure buffer local auto commands to add when attaching a language server
5861
autocmds = {

lua/astrolsp/config.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
---@class AstroLSPFeatureOpts
3232
---@field codelens boolean? enable/disable codelens refresh on start (boolean; default = true)
3333
---@field inlay_hints boolean? enable/disable inlay hints on start (boolean; default = false)
34+
---@field inline_completion boolean? enable/disable inline completion (boolean; default = false)
3435
---@field linked_editing_range boolean? enable/disable linked editing range (boolean; default = false)
3536
---@field semantic_tokens boolean? enable/disable semantic token highlighting (boolean; default = true)
3637
---@field signature_help boolean? enable/disable automatic signature help (boolean; default = false)
@@ -44,6 +45,7 @@
4445
---@class AstroLSPFormatOpts: vim.lsp.buf.format.Opts
4546
---@field format_on_save boolean|AstroLSPFormatOnSaveOpts? control formatting on save options
4647
---@field disabled true|string[]? true to disable all or a list like table of language server names to disable formatting
48+
---@field filter (fun(client):boolean)? a function for doing a custom formatting filter based on LSP client name
4749

4850
---@class AstroLSPFileOperationsOperationsOpts
4951
---@field willCreate boolean? enable/disable pre-create file notifications
@@ -290,6 +292,7 @@ local M = {
290292
features = {
291293
codelens = true,
292294
inlay_hints = false,
295+
inline_completion = false,
293296
linked_editing_range = false,
294297
semantic_tokens = true,
295298
signature_help = false,

lua/astrolsp/init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ function M.setup(opts)
298298
end
299299
-- TODO: remove check when dropping support for Neovim v0.11
300300
if vim.lsp.codelens.enable then vim.lsp.codelens.enable(M.config.features.codelens ~= false) end
301+
-- TODO: remove check when dropping support for Neovim v0.11
302+
if vim.lsp.inline_completion then vim.lsp.inline_completion.enable(M.config.features.inline_completion ~= false) end
301303

302304
-- Set up tracking of signature help trigger characters
303305
local augroup = vim.api.nvim_create_augroup("track_signature_help_triggers", { clear = true })

0 commit comments

Comments
 (0)