@@ -4,60 +4,57 @@ astrolsp API documentation
44
55## astrolsp
66
7- ### attached_clients
7+ AstroNvim LSP Utilities
88
9+ Various utility functions to use within AstroNvim for the LSP engine
910
10- ``` lua
11- table
12- ```
11+ This module can be loaded with ` local astro = require "astrolsp" `
1312
14- A table of LSP clients that have been attached with AstroLSP
13+ copyright 2023
14+ license GNU General Public License v3.0
1515
16- ### config
16+ ### add_on_attach
1717
1818
1919``` lua
20- AstroLSPOpts
20+ function astrolsp .add_on_attach (on_attach : fun ( client : vim.lsp.Client , bufnr : integer ), opts ?: { client_name : string ?, autocmd : ( vim.api.keyset.create_autocmd )? })
21+ -> autocmd_id : integer
2122```
2223
23- The configuration as set by the user through the ` setup() ` function
24+ Set up a given ` on_attach ` function to run when language servers are attached
2425
25- ### format_opts
26+ *param* ` on_attach` — the ` on_attach` function to run
27+
28+ *param* ` opts` — options for configuring the ` on_attach`
29+
30+ *return* ` autocmd_id` — The id for the created LspAttach autocommand
31+
32+ ### attached_clients
2633
2734
2835``` lua
29- unknown
36+ table
3037```
3138
32- Format options that are passed into the ` vim.lsp.buf.format ` ( ` :h vim.lsp.buf.format() ` )
39+ A table of LSP clients that have been attached with AstroLSP
3340
34- ### lsp_config
41+ ### config
3542
3643
3744``` lua
38- function astrolsp .lsp_config (server_name : string )
39- -> vim .lsp .Config
45+ AstroLSPOpts
4046```
4147
42- Configure the language server using ` vim.lsp.config `
43-
44- * param* ` server_name ` — The name of the server
45-
46- * return* — The resolved configuration
48+ The configuration as set by the user through the ` setup()` function
4749
48- ### lsp_opts
50+ ### format_opts
4951
5052
5153``` lua
52- function astrolsp .lsp_opts (server_name : string )
53- -> table
54+ unknown
5455```
5556
56- Get the server configuration for a given language server to be provided to the server's ` setup() ` call
57-
58- * param* ` server_name ` — The name of the server
59-
60- * return* — The table of LSP options used when setting up the given language server
57+ Format options that are passed into the ` vim.lsp.buf.format` (` :h vim.lsp.buf.format()` )
6158
6259### lsp_progress
6360
@@ -115,6 +112,18 @@ function astrolsp.setup(opts: AstroLSPOpts)
115112
116113## astrolsp.file_operations
117114
115+ AstroNvim LSP File Operation Utilities
116+
117+ Utilities for working with LSP based file operations
118+
119+ This module is heavily inspired by nvim-lsp-file-operations
120+ https://github.com/antosha417/nvim-lsp-file-operations/tree/master
121+
122+ This module can be loaded with ` local astrolsp_fileops = require "astrolsp.file_operations" `
123+
124+ copyright 2025
125+ license GNU General Public License v3.0
126+
118127### didCreateFiles
119128
120129
@@ -182,32 +191,16 @@ function astrolsp.file_operations.willRenameFiles(renames: AstroLSPFileOperation
182191* param* ` renames ` — a table or list of tables of files that will be renamed
183192
184193
185- ## astrolsp.mason-lspconfig
186-
187- ### register_server
188-
189-
190- ``` lua
191- function astrolsp .mason -lspconfig .register_server (server : string , spec : AstroLSPMasonLspconfigServer )
192- ```
193-
194- Register a new language server with mason-lspconfig
195-
196- * param* ` server ` — the server name in lspconfig
197-
198- * param* ` spec ` — the details for registering the server
199-
200- ### register_servers
201-
194+ ## astrolsp.toggles
202195
203- ``` lua
204- function astrolsp .mason -lspconfig .register_servers (server_specs ?: { [string ]: AstroLSPMasonLspconfigServer })
205- ```
196+ AstroNvim LSP Toggles
206197
207- Register multiple new language servers with mason-lspconfig
198+ Utility functions for easy LSP toggles
208199
200+ This module can be loaded with ` local ui = require("astrolsp.toggles") `
209201
210- ## astrolsp.toggles
202+ copyright 2023
203+ license GNU General Public License v3.0
211204
212205### autoformat
213206
@@ -233,6 +226,19 @@ function astrolsp.toggles.buffer_autoformat(bufnr?: integer, silent?: boolean)
233226
234227* param* ` silent ` — if true then don't sent a notification
235228
229+ ### buffer_codelens
230+
231+
232+ ``` lua
233+ function astrolsp .toggles .buffer_codelens (bufnr ?: integer , silent ?: boolean )
234+ ```
235+
236+ Toggle buffer codelens
237+
238+ * param* ` bufnr ` — the buffer to toggle the clients on
239+
240+ * param* ` silent ` — if true then don't sent a notification
241+
236242### buffer_inlay_hints
237243
238244
@@ -279,7 +285,7 @@ function astrolsp.toggles.buffer_signature_help(bufnr?: integer, silent?: boolea
279285function astrolsp .toggles .codelens (silent ?: boolean )
280286```
281287
282- Toggle codelens
288+ Toggle global codelens
283289
284290* param* ` silent ` — if true then don't sent a notification
285291
@@ -294,45 +300,26 @@ function astrolsp.toggles.inlay_hints(silent?: boolean)
294300
295301* param* ` silent ` — if true then don't sent a notification
296302
297- ### signature_help
303+ ### semantic_tokens
298304
299305
300306``` lua
301- function astrolsp .toggles .signature_help (silent ?: boolean )
307+ function astrolsp .toggles .semantic_tokens (silent ?: boolean )
302308```
303309
304- Toggle automatic signature help
310+ Toggle global semantic token highlighting for all language servers that support it
305311
306312* param* ` silent ` — if true then don't sent a notification
307313
308-
309- ## astrolsp.utils
310-
311- ### notify
312-
313-
314- ``` lua
315- function astrolsp .utils .notify (client : vim.lsp.Client , method : string , params ?: table )
316- ```
317-
318- Helper function to support deprecated notify usage
319-
320- ### request_sync
314+ ### signature_help
321315
322316
323317``` lua
324- function astrolsp .utils . request_sync ( client : vim.lsp.Client , req : string , params : table , timeout ?: integer , bufnr ?: integer )
318+ function astrolsp .toggles . signature_help ( silent ?: boolean )
325319```
326320
327- Helper function to support deprecated request_sync usage
328-
329- ### supports_method
330-
331-
332- ``` lua
333- function astrolsp .utils .supports_method (client : vim.lsp.Client , method : string , bufnr ?: integer )
334- ```
321+ Toggle automatic signature help
335322
336- Helper function to support deprecated supports_method usage
323+ * param * ` silent ` — if true then don't sent a notification
337324
338325
0 commit comments