All Projects → doums → lsp_spinner.nvim

doums / lsp_spinner.nvim

Licence: other
neovim plugin to retrieve the name of the running LSP client(s) and display a spinner when there are wip job

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to lsp spinner.nvim

Lsp Status.nvim
Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
Stars: ✭ 201 (+773.91%)
Mutual labels:  nvim, statusline, lsp
vim-lamp
💡Language Server Protocol client for Vim.
Stars: ✭ 34 (+47.83%)
Mutual labels:  nvim, lsp
feline.nvim
A minimal, stylish and customizable statusline for Neovim written in Lua
Stars: ✭ 867 (+3669.57%)
Mutual labels:  nvim, statusline
lspactions
handlers for required lsp actions
Stars: ✭ 44 (+91.3%)
Mutual labels:  nvim, lsp
nvim-metals
A Metals plugin for Neovim
Stars: ✭ 265 (+1052.17%)
Mutual labels:  nvim, lsp
bubbly.nvim
Bubbly statusline for neovim
Stars: ✭ 185 (+704.35%)
Mutual labels:  nvim, statusline
fzf-lsp.nvim
Enable the power of fzf fuzzy search for the neovim built in lsp
Stars: ✭ 143 (+521.74%)
Mutual labels:  nvim, lsp
nvim-config
My neovim config
Stars: ✭ 63 (+173.91%)
Mutual labels:  nvim, lsp
Thinkvim
Vim configuration in the 21st century
Stars: ✭ 832 (+3517.39%)
Mutual labels:  nvim, lsp
Nvim Lspconfig
Quickstart configurations for the Nvim LSP client
Stars: ✭ 3,410 (+14726.09%)
Mutual labels:  nvim, lsp
Lualine.nvim
A blazing fast and easy to configure neovim statusline written in pure lua.
Stars: ✭ 198 (+760.87%)
Mutual labels:  nvim, statusline
py lsp.nvim
Lsp Plugin for working with Python virtual environments
Stars: ✭ 58 (+152.17%)
Mutual labels:  nvim, lsp
coc-java-debug
An extension for coc.nvim to enable Java debugging via jdt.ls
Stars: ✭ 92 (+300%)
Mutual labels:  nvim, lsp
neovimfiles
My Neovim configuration written in Lua
Stars: ✭ 52 (+126.09%)
Mutual labels:  nvim, lsp
lsp-command
Command interface for neovim LSP
Stars: ✭ 48 (+108.7%)
Mutual labels:  nvim, lsp
aerial.nvim
Neovim plugin for a code outline window
Stars: ✭ 485 (+2008.7%)
Mutual labels:  nvim, lsp
lxtk
Language Client/Server Toolkit
Stars: ✭ 22 (-4.35%)
Mutual labels:  lsp, lsp-client
lsp-metals
lsp-mode ❤️ metals
Stars: ✭ 49 (+113.04%)
Mutual labels:  lsp, lsp-client
vimrc
My neovim config
Stars: ✭ 43 (+86.96%)
Mutual labels:  nvim, lsp
nvim-fennel-lsp-conjure-as-clojure-ide
Basic config to transform your NVIM in a powerful Clojure IDE using fennel, clojure-lsp and conjure.
Stars: ✭ 144 (+526.09%)
Mutual labels:  nvim, lsp

lsp_spinner.nvim

Nvim library to get the name of the running LSP client(s) and a spinner when there are jobs in progress. Intended for use in statusline.

Install

paq('doums/lsp_spinner.nvim')

Setup

local lspconfig = require('lspconfig')
local lsp_spinner = require('lsp_spinner')

-- register an handler for `$/progress` method
-- options are optional
lsp_spinner.setup({
  spinner = {
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
  },
  interval = 80, -- spinner frame rate in ms
  redraw_rate = 100, -- max refresh rate of statusline in ms
  -- placeholder displayed in place of the spinner when there is
  -- no activity for a given LSP client
  placeholder = ' ',
})

local capabilities = lsp.protocol.make_client_capabilities()

-- turn on `window/workDoneProgress` capability
lsp_spinner.init_capabilities(capabilities)

local function on_attach(client, bufnr)
  -- ... other stuff

  lsp_spinner.on_attach(client, bufnr)
end

-- Rust Analyzer setup
lspconfig.rust_analyzer.setup({
  on_attach = on_attach,
  capabilities = capabilities,
})

Usage

The library exposes 2 Lua functions:

  • status()

Returns (string) the name(s) of all running LSP client(s).
Returns nil if there is no running client.

local status = require('lsp_spinner').status()
  • buf_status(bufnr)

Returns (string) the name(s) of the running LSP client(s) attached to the given buffer. If no bufnr is given, the current buffer is used.
Returns nil if there is no running client.

local status = require('lsp_spinner').buf_status(bufnr)

Each client name is followed by a spinner frame if there is work in progress for the given client.

Example with ponton.nvim

    lsp_spinner = {
      style = { '#C5656B', line_bg },
      fn = require('lsp_spinner').status,
      padding = { nil, 2 },
    },

License

Mozilla Public License 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].