diff options
| author | Raphael <glepnir@neovim.pro> | 2023-07-26 15:10:48 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-26 15:10:48 +0800 |
| commit | 654dd9e95c49f64726b8751d75cbe147ec626875 (patch) | |
| tree | ff1a5cc204bdb98258076781e4150a60368a4125 /lua/lspconfig/server_configurations/rust_analyzer.lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-654dd9e95c49f64726b8751d75cbe147ec626875.tar nvim-lspconfig-654dd9e95c49f64726b8751d75cbe147ec626875.tar.gz nvim-lspconfig-654dd9e95c49f64726b8751d75cbe147ec626875.tar.bz2 nvim-lspconfig-654dd9e95c49f64726b8751d75cbe147ec626875.tar.lz nvim-lspconfig-654dd9e95c49f64726b8751d75cbe147ec626875.tar.xz nvim-lspconfig-654dd9e95c49f64726b8751d75cbe147ec626875.tar.zst nvim-lspconfig-654dd9e95c49f64726b8751d75cbe147ec626875.zip | |
fix(rust_analyzer): check active clients is empty (#2734)
Diffstat (limited to 'lua/lspconfig/server_configurations/rust_analyzer.lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/rust_analyzer.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/lspconfig/server_configurations/rust_analyzer.lua b/lua/lspconfig/server_configurations/rust_analyzer.lua index 8ef2f10e..fc79046d 100644 --- a/lua/lspconfig/server_configurations/rust_analyzer.lua +++ b/lua/lspconfig/server_configurations/rust_analyzer.lua @@ -20,7 +20,7 @@ local function is_library(fname) for _, item in ipairs { toolchains, registry } do if fname:sub(1, #item) == item then local clients = vim.lsp.get_active_clients { name = 'rust_analyzer' } - return clients[#clients].config.root_dir + return #clients > 0 and clients[#clients].config.root_dir or nil end end end |
