mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00
fix(lsp): check if buffer was detached in on_init callback (#28942)
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
(cherry picked from commit af200c10cf
)
Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
This commit is contained in:
![41898282+github-actions[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
GitHub

parent
10a16c1311
commit
bdd5871dc5
@@ -95,11 +95,11 @@ describe('semantic token highlighting', function()
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
['textDocument/semanticTokens/full'] = function()
|
||||
return vim.fn.json_decode(response)
|
||||
['textDocument/semanticTokens/full'] = function(_, _, callback)
|
||||
callback(nil, vim.fn.json_decode(response))
|
||||
end,
|
||||
['textDocument/semanticTokens/full/delta'] = function()
|
||||
return vim.fn.json_decode(edit_response)
|
||||
['textDocument/semanticTokens/full/delta'] = function(_, _, callback)
|
||||
callback(nil, vim.fn.json_decode(edit_response))
|
||||
end,
|
||||
}
|
||||
})
|
||||
@@ -503,11 +503,11 @@ describe('semantic token highlighting', function()
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
['textDocument/semanticTokens/full'] = function()
|
||||
return nil
|
||||
['textDocument/semanticTokens/full'] = function(_, _, callback)
|
||||
callback(nil, nil)
|
||||
end,
|
||||
['textDocument/semanticTokens/full/delta'] = function()
|
||||
return nil
|
||||
callback(nil, nil)
|
||||
end,
|
||||
}
|
||||
})
|
||||
@@ -551,11 +551,11 @@ describe('semantic token highlighting', function()
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
['textDocument/semanticTokens/full'] = function()
|
||||
return vim.fn.json_decode(response)
|
||||
['textDocument/semanticTokens/full'] = function(_, _, callback)
|
||||
callback(nil, vim.fn.json_decode(response))
|
||||
end,
|
||||
['textDocument/semanticTokens/full/delta'] = function()
|
||||
return vim.fn.json_decode(edit_response)
|
||||
['textDocument/semanticTokens/full/delta'] = function(_, _, callback)
|
||||
callback(nil, vim.fn.json_decode(edit_response))
|
||||
end,
|
||||
}
|
||||
})
|
||||
@@ -1018,8 +1018,8 @@ b = "as"]],
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
['textDocument/semanticTokens/full'] = function()
|
||||
return vim.fn.json_decode(resp)
|
||||
['textDocument/semanticTokens/full'] = function(_, _, callback)
|
||||
callback(nil, vim.fn.json_decode(resp))
|
||||
end,
|
||||
}
|
||||
})
|
||||
@@ -1404,11 +1404,11 @@ int main()
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
['textDocument/semanticTokens/full'] = function()
|
||||
return vim.fn.json_decode(resp1)
|
||||
['textDocument/semanticTokens/full'] = function(_, _, callback)
|
||||
callback(nil, vim.fn.json_decode(resp1))
|
||||
end,
|
||||
['textDocument/semanticTokens/full/delta'] = function()
|
||||
return vim.fn.json_decode(resp2)
|
||||
['textDocument/semanticTokens/full/delta'] = function(_, _, callback)
|
||||
callback(nil, vim.fn.json_decode(resp2))
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user