We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3aa6df5 commit c19f945Copy full SHA for c19f945
lua/flutter-tools/lsp/utils.lua
@@ -4,10 +4,11 @@ local lsp = vim.lsp
4
5
M.SERVER_NAME = "dartls"
6
7
+-- TODO: Remove after compatibility with Neovim=0.9 is dropped
8
+local get_clients = vim.fn.has("nvim-0.10") == 1 and lsp.get_clients or lsp.get_active_clients
9
+
10
---@param bufnr number?
----@return lsp.Client?
-function M.get_dartls_client(bufnr)
- return lsp.get_active_clients({ name = M.SERVER_NAME, bufnr = bufnr })[1]
11
-end
+---@return vim.lsp.Client?
12
+function M.get_dartls_client(bufnr) return get_clients({ name = M.SERVER_NAME, bufnr = bufnr })[1] end
13
14
return M
0 commit comments