mirror of
https://github.com/neovim/neovim.git
synced 2026-04-30 11:14:10 +00:00
feat(lsp): move inlay_hint() to vim.lsp (#24130)
Allows to keep more functions hidden and gives a path forward for further inlay_hint related functions - like applying textEdits. See https://github.com/neovim/neovim/pull/23984#pullrequestreview-1486624668
This commit is contained in:
committed by
GitHub
parent
d55d7646c1
commit
37079fca58
@@ -64,7 +64,7 @@ describe('inlay hints', function()
|
||||
end)
|
||||
|
||||
it(
|
||||
'inlay hints are applied when vim.lsp.buf.inlay_hint(true) is called',
|
||||
'inlay hints are applied when vim.lsp.inlay_hint(true) is called',
|
||||
function()
|
||||
local res = exec_lua([[
|
||||
bufnr = vim.api.nvim_get_current_buf()
|
||||
@@ -79,7 +79,7 @@ describe('inlay hints', function()
|
||||
|
||||
|
||||
insert(text)
|
||||
exec_lua([[vim.lsp.buf.inlay_hint(bufnr, true)]])
|
||||
exec_lua([[vim.lsp.inlay_hint(bufnr, true)]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
auto add(int a, int b)-> int { return a + b; } |
|
||||
@@ -96,7 +96,7 @@ describe('inlay hints', function()
|
||||
end)
|
||||
|
||||
it(
|
||||
'inlay hints are cleared when vim.lsp.buf.inlay_hint(false) is called',
|
||||
'inlay hints are cleared when vim.lsp.inlay_hint(false) is called',
|
||||
function()
|
||||
exec_lua([[
|
||||
bufnr = vim.api.nvim_get_current_buf()
|
||||
@@ -105,7 +105,7 @@ describe('inlay hints', function()
|
||||
]])
|
||||
|
||||
insert(text)
|
||||
exec_lua([[vim.lsp.buf.inlay_hint(bufnr, true)]])
|
||||
exec_lua([[vim.lsp.inlay_hint(bufnr, true)]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
auto add(int a, int b)-> int { return a + b; } |
|
||||
@@ -119,7 +119,7 @@ describe('inlay hints', function()
|
||||
|
|
||||
]]
|
||||
})
|
||||
exec_lua([[vim.lsp.buf.inlay_hint(bufnr, false)]])
|
||||
exec_lua([[vim.lsp.inlay_hint(bufnr, false)]])
|
||||
screen:expect({
|
||||
grid = [[
|
||||
auto add(int a, int b) { return a + b; } |
|
||||
|
||||
Reference in New Issue
Block a user