Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(lsp): when buffer detach remove buffer from client attached buffers#20081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mfussenegger merged 2 commits intoneovim:masterfromglepnir:lsp_buf
Sep 8, 2022
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
fixup! fix(lsp): when buffer detach remove buffer from client attache…
…d buffers
  • Loading branch information
@mfussenegger
mfussenegger committedSep 8, 2022
commitc28f6a2eac52ec75f202ebe6b8886b2566b01d1c
36 changes: 36 additions & 0 deletionstest/functional/plugin/lsp_spec.lua
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -418,6 +418,42 @@ describe('LSP', function()
}
end)

it('should detach buffer on bufwipe', function()
local result = exec_lua([[
local server = function(dispatchers)
local closing = false
return {
request = function(method, params, callback)
if method == 'initialize' then
callback(nil, { capabilities = {} })
end
end,
notify = function(...)
end,
is_closing = function() return closing end,
terminate = function() closing = true end
}
end
local bufnr = vim.api.nvim_create_buf(false, true)
vim.api.nvim_set_current_buf(bufnr)
local client_id = vim.lsp.start({ name = 'detach-dummy', cmd = server })
assert(client_id, "lsp.start must return client_id")
local client = vim.lsp.get_client_by_id(client_id)
local num_attached_before = vim.tbl_count(client.attached_buffers)
vim.api.nvim_buf_delete(bufnr, { force = true })
local num_attached_after = vim.tbl_count(client.attached_buffers)
return {
bufnr = bufnr,
client_id = client_id,
num_attached_before = num_attached_before,
num_attached_after = num_attached_after,
}
]])
eq(true, result ~= nil, "exec_lua must return result")
eq(1, result.num_attached_before)
eq(0, result.num_attached_after)
end)

it('client should return settings via workspace/configuration handler', function()
local expected_handlers = {
{NIL, {}, {method="shutdown", client_id=1}};
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp