From cb6eef2314a53cd4119bf6a8b1d203b7b927d562 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Tue, 2 Feb 2021 20:13:07 +0530 Subject: [PATCH] nvim: lua: lsp: Drop lsp-status We use galaxyline for the status line and it already provides LSP diagnostics info. So drop lsp-status. While the progress message during the loading in status line is nice, may be will incorporate it later by picking only the required pieces. While at it, expose all diagnostics via statusline using galaxyline components. --- nvim/.config/nvim/lua/lsp.lua | 17 ------------- nvim/.config/nvim/lua/modules/statusline.lua | 26 +++++++++----------- nvim/.config/nvim/lua/plugins.lua | 1 - 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index fb5c841..3dc7d65 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -1,5 +1,4 @@ local nvim_lsp = require('lspconfig') -local lsp_status = require('lsp-status') local lsp_fuzzy = require('lspfuzzy') local protocol = require('vim.lsp.protocol') @@ -47,7 +46,6 @@ end local on_attach = function(client, bufnr) vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - lsp_status.on_attach(client, bufnr) if client.config.flags then client.config.flags.allow_incremental_sync = true @@ -105,22 +103,7 @@ end local servers = { 'hls', 'rust_analyzer' } for _, lsp in ipairs(servers) do lsp_fuzzy.setup {} - lsp_status.register_progress() - lsp_status.config({ - kind_labels = {}, - current_function = true, - indicator_separator = ' ', - indicator_errors = '  ', - indicator_warnings = '  ', - indicator_info = ' 🛈 ', - indicator_hint = '❗', - indicator_ok = '  ', - spinner_frames = { '⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷' }, - status_symbol = ' 🇻 ', - select_symbol = nil - }) nvim_lsp[lsp].setup { on_attach = on_attach, - capabilities = lsp_status.capabilities } end diff --git a/nvim/.config/nvim/lua/modules/statusline.lua b/nvim/.config/nvim/lua/modules/statusline.lua index 194153c..a1e16ae 100644 --- a/nvim/.config/nvim/lua/modules/statusline.lua +++ b/nvim/.config/nvim/lua/modules/statusline.lua @@ -1,4 +1,3 @@ -local lsp_status = require('lsp-status') local gl = require('galaxyline') local gls = gl.section @@ -128,25 +127,24 @@ gls.left[11] = { } } gls.left[12] = { - Space = { - provider = function () return ' ' end - } -} -gls.left[13] = { DiagnosticWarn = { provider = 'DiagnosticWarn', icon = '  ', - highlight = { colors.blue, colors.bg }, + highlight = { colors.yellow, colors.bg }, + } +} +gls.left[13] = { + DiagnosticHint = { + provider = 'DiagnosticHint', + icon = '  ', + highlight = {colors.orange,colors.bg}, } } gls.left[14] = { - LspStatus = { - provider = function() - if #vim.lsp.buf_get_clients() > 0 then - return lsp_status.status() - end - end, - highlight = { colors.orange, colors.bg,'bold' }, + DiagnosticInfo = { + provider = 'DiagnosticInfo', + icon = '  ', + highlight = {colors.cyan,colors.bg}, } } diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index e5eaf0b..c1efa1c 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -117,7 +117,6 @@ local init = function () use { 'neovim/nvim-lspconfig', 'ojroques/nvim-lspfuzzy', - 'nvim-lua/lsp-status.nvim' } -- Language support & syntax highlighting -- Haskell