Skip to content

Commit 7a9a2a7

Browse files
committed
Update docs
1 parent 666e7ba commit 7a9a2a7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ call packager#add('wbthomason/lsp-status.nvim')
4040

4141
## Usage
4242

43-
The plugin provides several functions which you can call:
43+
The plugin provides several utilities:
4444
```lua
4545
update_current_function() -- Set/reset the b:lsp_current_function variable
4646
diagnostics() -- Return a table with all diagnostic counts for the current buffer
@@ -55,6 +55,8 @@ extensions = { clangd, pyls_ms }
5555
-- buffer autocommands
5656
on_attach(client)
5757
config(config_vals) -- Configure lsp-status
58+
-- Table of client capabilities extended to signal support for progress messages
59+
capabilities
5860
status() -- One example out-of-the-box statusline component (as shown in the images above)
5961
```
6062
### Protocol Extensions
@@ -66,6 +68,8 @@ server](https://github.com/Microsoft/python-language-server) (`python/setStatusB
6668
register the callbacks provided in the `extensions` table (the keys for the callbacks are
6769
the relevant LSP method name).
6870

71+
**Note:** For `clangd`, you must also set `init_options = { clangdFileStatus = true }`.
72+
6973
**New**: You can also call `lsp_status.extensions.<server name>.setup()` to return the full set of
7074
callbacks, as shown below.
7175

@@ -119,6 +123,12 @@ lsp_status.config { kind_labels = vim.g.completion_customize_lsp_label }
119123
lsp_status.register_progress()
120124
```
121125

126+
**Before calling `setup` for each relevant LSP client:**
127+
```lua
128+
-- Set default client capabilities plus window/workDoneProgress
129+
config.capabilities = vim.tbl_extend('keep', config.capabilities or {}, lsp_status.capabilities)
130+
```
131+
122132
**In an `on_attach` function for each relevant LSP client:**
123133
```lua
124134
-- Register client for messages and set up buffer autocommands to update

0 commit comments

Comments
 (0)