diff options
| author | kylo252 <[email protected]> | 2022-04-14 21:24:35 +0200 | 
|---|---|---|
| committer | kylo252 <[email protected]> | 2022-04-14 21:24:35 +0200 | 
| commit | 6d2e18295f510c2f2167bd911b0d421a3b7f112e (patch) | |
| tree | 453d5be502febdf596bf4b60b2d982b8b94db44a /lua/lvim/core | |
| parent | f92a0d610c1ee899ec8acb091130f2a5eec22812 (diff) | |
| parent | 09684eff642eb455bffda3100f29ef182f734a82 (diff) | |
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/core')
| -rw-r--r-- | lua/lvim/core/cmp.lua | 5 | ||||
| -rw-r--r-- | lua/lvim/core/info.lua | 30 | ||||
| -rw-r--r-- | lua/lvim/core/log.lua | 6 | 
3 files changed, 23 insertions, 18 deletions
| diff --git a/lua/lvim/core/cmp.lua b/lua/lvim/core/cmp.lua index 621e2b6d..8fb18c5f 100644 --- a/lua/lvim/core/cmp.lua +++ b/lua/lvim/core/cmp.lua @@ -232,8 +232,9 @@ M.config = function()          require("luasnip").lsp_expand(args.body)        end,      }, -    documentation = { -      border = { "â•", "─", "â•®", "│", "╯", "─", "â•°", "│" }, +    window = { +      completion = cmp.config.window.bordered(), +      documentation = cmp.config.window.bordered(),      },      sources = {        { name = "nvim_lsp" }, diff --git a/lua/lvim/core/info.lua b/lua/lvim/core/info.lua index 9c9652da..00a7e85a 100644 --- a/lua/lvim/core/info.lua +++ b/lua/lvim/core/info.lua @@ -100,21 +100,26 @@ local function make_client_info(client)    return client_info  end -local function make_override_info(ft) +local function make_auto_lsp_info(ft) +  local skipped_filetypes = lvim.lsp.automatic_configuration.skipped_filetypes +  local skipped_servers = lvim.lsp.automatic_configuration.skipped_servers +  local info_lines = { "Automatic LSP info" } + +  if vim.tbl_contains(skipped_filetypes, ft) then +    vim.list_extend(info_lines, { "* Status: disabled for " .. ft }) +    return info_lines +  end +    local available = lsp_utils.get_supported_servers_per_filetype(ft) -  local overridden = vim.tbl_filter(function(name) +  local skipped = vim.tbl_filter(function(name)      return vim.tbl_contains(available, name) -  end, lvim.lsp.override) +  end, skipped_servers) -  local info_lines = { "" } -  if #overridden == 0 then -    return info_lines +  if #skipped == 0 then +    return { "" }    end -  info_lines = { -    fmt("Overridden %s server(s)", ft), -    fmt("* list: %s", str_list(overridden)), -  } +  vim.list_extend(info_lines, { fmt("* Skipped servers: %s", str_list(skipped)) })    return info_lines  end @@ -150,7 +155,7 @@ function M.toggle_popup(ft)      table.insert(client_names, client.name)    end -  local override_info = make_override_info(ft) +  local auto_lsp_info = make_auto_lsp_info(ft)    local formatters_info = make_formatters_info(ft) @@ -169,7 +174,7 @@ function M.toggle_popup(ft)        { "" },        lsp_info,        { "" }, -      override_info, +      auto_lsp_info,        { "" },        formatters_info,        { "" }, @@ -192,6 +197,7 @@ function M.toggle_popup(ft)      vim.fn.matchadd("LvimInfoHeader", "Formatters info")      vim.fn.matchadd("LvimInfoHeader", "Linters info")      vim.fn.matchadd("LvimInfoHeader", "Code actions info") +    vim.fn.matchadd("LvimInfoHeader", "Automatic LSP info")      vim.fn.matchadd("LvimInfoIdentifier", " " .. ft .. "$")      vim.fn.matchadd("string", "true")      vim.fn.matchadd("string", "active") diff --git a/lua/lvim/core/log.lua b/lua/lvim/core/log.lua index d0e74f18..15ccb11c 100644 --- a/lua/lvim/core/log.lua +++ b/lua/lvim/core/log.lua @@ -1,7 +1,5 @@  local Log = {} -local logfile = string.format("%s/%s.log", get_cache_dir(), "lvim") -  Log.levels = {    TRACE = 1,    DEBUG = 2, @@ -39,7 +37,7 @@ function Log:init()              { level = structlog.formatters.FormatColorizer.color_level() }            ),          }), -        structlog.sinks.File(log_level, logfile, { +        structlog.sinks.File(log_level, self:get_path(), {            processors = {              structlog.processors.Namer(),              structlog.processors.StackWriter({ "line", "file" }, { max_parents = 3, stack_level = 2 }), @@ -155,7 +153,7 @@ end  ---Retrieves the path of the logfile  ---@return string path of the logfile  function Log:get_path() -  return logfile +  return string.format("%s/%s.log", get_cache_dir(), "lvim")  end  ---Add a log entry at TRACE level | 
