Skip to content

Commit f94ec6c

Browse files
committed
More clarification and remember to add capabilities
1 parent 9157ae5 commit f94ec6c

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ showing how `lsp-status` can be integrated into one's statusline and other LSP c
118118
```lua
119119
local lsp_status = require('lsp-status')
120120
-- completion_customize_lsp_label as used in completion-nvim
121-
-- Optional: customize the kind labels used in identifying the current function
121+
-- Optional: customize the kind labels used in identifying the current function.
122+
-- g:completion_customize_lsp_label is a dict mapping from LSP symbol kind
123+
-- to the string you want to display as a label
122124
-- lsp_status.config { kind_labels = vim.g.completion_customize_lsp_label }
123125

124126
-- Register the progress callback
@@ -134,7 +136,8 @@ config.capabilities = vim.tbl_extend('keep', config.capabilities or {}, lsp_stat
134136
**In an `on_attach` function for each relevant LSP client:**
135137
```lua
136138
-- Register client for messages and set up buffer autocommands to update
137-
-- the statusline and the current function
139+
-- the statusline and the current function.
140+
-- NOTE: on_attach is called with the client object, which is the "client" parameter below
138141
lsp_status.on_attach(client)
139142
```
140143

@@ -173,17 +176,25 @@ nvim_lsp.clangd.setup({
173176
init_options = {
174177
clangdFileStatus = true
175178
},
176-
on_attach = lsp_status.on_attach
179+
on_attach = lsp_status.on_attach,
180+
capabilities = lsp_status.capabilities
177181
})
178182
179183
nvim_lsp.pyls_ms.setup({
180184
callbacks = lsp_status.extensions.pyls_ms.setup(),
181185
settings = { python = { workspaceSymbols = { enabled = true }}},
182-
on_attach = lsp_status.on_attach
186+
on_attach = lsp_status.on_attach,
187+
capabilities = lsp_status.capabilities
183188
})
184189
185-
nvim_lsp.ghcide.setup({ on_attach = lsp_status.on_attach })
186-
nvim_lsp.rust_analyzer.setup({ on_attach = lsp_status.on_attach })
190+
nvim_lsp.ghcide.setup({
191+
on_attach = lsp_status.on_attach,
192+
capabilities = lsp_status.capabilities
193+
})
194+
nvim_lsp.rust_analyzer.setup({
195+
on_attach = lsp_status.on_attach,
196+
capabilities = lsp_status.capabilities
197+
})
187198
END
188199
189200
" Statusline

0 commit comments

Comments
 (0)