From 4ec3f7716ccadd5c010bc3ab747a8e5d3978803d Mon Sep 17 00:00:00 2001 From: bhagwan Date: Mon, 19 Jul 2021 23:37:54 -0700 Subject: [PATCH] LSP diagnostics verify attached client --- lua/fzf-lua/providers/lsp.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/fzf-lua/providers/lsp.lua b/lua/fzf-lua/providers/lsp.lua index 932eb60..ef15675 100644 --- a/lua/fzf-lua/providers/lsp.lua +++ b/lua/fzf-lua/providers/lsp.lua @@ -290,6 +290,12 @@ end M.diagnostics = function(opts) opts = normalize_lsp_opts(opts, config.lsp) + local lsp_clients = vim.lsp.buf_get_clients(0) + if #lsp_clients == 0 then + utils.info("LSP: no client attached") + return + end + local lsp_type_diagnostic = vim.lsp.protocol.DiagnosticSeverity local current_buf = vim.api.nvim_get_current_buf()