@@ -118,7 +118,9 @@ showing how `lsp-status` can be integrated into one's statusline and other LSP c
118
118
``` lua
119
119
local lsp_status = require (' lsp-status' )
120
120
-- 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
122
124
-- lsp_status.config { kind_labels = vim.g.completion_customize_lsp_label }
123
125
124
126
-- Register the progress callback
@@ -134,7 +136,8 @@ config.capabilities = vim.tbl_extend('keep', config.capabilities or {}, lsp_stat
134
136
** In an ` on_attach ` function for each relevant LSP client:**
135
137
``` lua
136
138
-- 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
138
141
lsp_status .on_attach (client )
139
142
```
140
143
@@ -173,17 +176,25 @@ nvim_lsp.clangd.setup({
173
176
init_options = {
174
177
clangdFileStatus = true
175
178
},
176
- on_attach = lsp_status.on_attach
179
+ on_attach = lsp_status.on_attach,
180
+ capabilities = lsp_status.capabilities
177
181
})
178
182
179
183
nvim_lsp.pyls_ms.setup({
180
184
callbacks = lsp_status.extensions.pyls_ms.setup(),
181
185
settings = { python = { workspaceSymbols = { enabled = true }}},
182
- on_attach = lsp_status.on_attach
186
+ on_attach = lsp_status.on_attach,
187
+ capabilities = lsp_status.capabilities
183
188
})
184
189
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
+ })
187
198
END
188
199
189
200
" Statusline
0 commit comments