Switch unmaintained lsp-status to lsp-progress
This commit is contained in:
parent
7d42f1af29
commit
2c5d7faba6
3 changed files with 62 additions and 45 deletions
|
@ -8,7 +8,6 @@ return {
|
|||
{ "folke/neodev.nvim", opts = {} },
|
||||
"mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"nvim-lua/lsp-status.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
|
@ -29,7 +28,7 @@ return {
|
|||
severity_sort = true,
|
||||
},
|
||||
-- add any global capabilities here
|
||||
capabilities = { require("lsp-status").capabilities },
|
||||
capabilities = {},
|
||||
servers = {
|
||||
jsonls = {},
|
||||
lua_ls = {
|
||||
|
@ -177,12 +176,5 @@ return {
|
|||
end
|
||||
end,
|
||||
},
|
||||
"mfussenegger/nvim-jdtls",
|
||||
{
|
||||
"nvim-lua/lsp-status.nvim",
|
||||
config = function(_, opts)
|
||||
local lsp_status = require("lsp-status")
|
||||
lsp_status.register_progress()
|
||||
end,
|
||||
},
|
||||
'mfussenegger/nvim-jdtls',
|
||||
}
|
||||
|
|
|
@ -2,8 +2,13 @@ return {
|
|||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {
|
||||
{ 'kyazdani42/nvim-web-devicons', lazy = true },
|
||||
'nvim-lua/lsp-status.nvim',
|
||||
'crater2150/vim-theme-chroma',
|
||||
{
|
||||
'linrongbin16/lsp-progress.nvim',
|
||||
config = function()
|
||||
require('lsp-progress').setup()
|
||||
end
|
||||
},
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
|
@ -24,7 +29,10 @@ return {
|
|||
fmt = function(name, context)
|
||||
local buflist = vim.fn.tabpagebuflist(context.tabnr)
|
||||
local mod = not vim.tbl_isempty(vim.tbl_filter(
|
||||
function(bufnr) return vim.fn.getbufvar(bufnr, '&mod') == 1 end,
|
||||
function(bufnr)
|
||||
return vim.fn.getbufvar(bufnr, '&mod') ==
|
||||
1
|
||||
end,
|
||||
buflist))
|
||||
|
||||
local wincount = #vim.tbl_filter(
|
||||
|
@ -32,14 +40,21 @@ return {
|
|||
vim.tbl_flatten(vim.fn.winlayout(context.tabnr))
|
||||
)
|
||||
|
||||
return name .. (wincount > 1 and ' +' .. (wincount - 1) or '') .. (mod and ' [✏️]]' or '')
|
||||
return name ..
|
||||
(wincount > 1 and ' +' .. (wincount - 1) or '') ..
|
||||
(mod and ' [✏️]]' or '')
|
||||
end
|
||||
} }
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'filename' },
|
||||
lualine_b = { 'diff', 'diagnostics' },
|
||||
lualine_x = { "require'lsp-status'.status()" },
|
||||
lualine_x = {
|
||||
function()
|
||||
-- invoke `progress` here.
|
||||
return require('lsp-progress').progress()
|
||||
end
|
||||
},
|
||||
lualine_y = { 'filetype' },
|
||||
lualine_z = { 'searchcount', 'selectioncount', 'location' }
|
||||
},
|
||||
|
@ -56,4 +71,13 @@ return {
|
|||
extensions = {}
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("lualine").setup(opts)
|
||||
vim.api.nvim_create_augroup("lualine_augroup", { clear = true })
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
group = "lualine_augroup",
|
||||
pattern = "LspProgressStatusUpdated",
|
||||
callback = require("lualine").refresh,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue