diff options
Diffstat (limited to 'lua/lvim/lsp/utils.lua')
| -rw-r--r-- | lua/lvim/lsp/utils.lua | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/lua/lvim/lsp/utils.lua b/lua/lvim/lsp/utils.lua index 3be7e52f..c2ffe3fa 100644 --- a/lua/lvim/lsp/utils.lua +++ b/lua/lvim/lsp/utils.lua @@ -1,6 +1,7 @@  local M = {}  local tbl = require "lvim.utils.table" +local Log = require "lvim.core.log"  function M.is_client_active(name)    local clients = vim.lsp.get_active_clients() @@ -82,6 +83,10 @@ function M.get_all_supported_filetypes()  end  function M.setup_document_highlight(client, bufnr) +  if lvim.builtin.illuminate.active then +    Log:debug "skipping setup for document_highlight, illuminate already active" +    return +  end    local status_ok, highlight_supported = pcall(function()      return client.supports_method "textDocument/documentHighlight"    end) @@ -114,6 +119,19 @@ function M.setup_document_highlight(client, bufnr)    })  end +function M.setup_document_symbols(client, bufnr) +  vim.g.navic_silence = false -- can be set to true to supress error +  local symbols_supported = client.supports_method "textDocument/documentSymbol" +  if not symbols_supported then +    Log:debug("skipping setup for document_symbols, method not supported by " .. client.name) +    return +  end +  local status_ok, navic = pcall(require, "nvim-navic") +  if status_ok then +    navic.attach(client, bufnr) +  end +end +  function M.setup_codelens_refresh(client, bufnr)    local status_ok, codelens_supported = pcall(function()      return client.supports_method "textDocument/codeLens" | 
