Skip to content

Commit f426d89

Browse files
committed
docs: correct public source documentation
1 parent 492e503 commit f426d89

4 files changed

Lines changed: 25 additions & 25 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ require("astrolsp").setup {
4343

4444
## ⚙️ Configuration
4545

46-
**AstroLSP** comes with the no defaults, but can be configured fully through the `opts` table in lazy or through calling `require("astrolsp").setup({})`. Here are descriptions of the options and some example usages:
46+
**AstroLSP** defaults to CodeLens refresh, semantic token highlighting, enabled format on save, and a 10-second file-operation timeout; file-operation methods are disabled until configured. Configure it through the `opts` table in lazy or by calling `require("astrolsp").setup({})`. Here are descriptions of the options and some example usages:
4747

4848
```lua
49-
---@type AstroLSPConfig
49+
---@type AstroLSPOpts
5050
local opts = {
5151
-- Configuration table of features provided by AstroLSP
5252
features = {

‎lua/astrolsp/config.lua‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
---@field filter (fun(client):boolean)? a function for doing a custom formatting filter based on LSP client name
4949

5050
---@class AstroLSPFileOperationsOperationsOpts
51-
---@field willCreate boolean? enable/disable pre-create file notifications
52-
---@field willDelete boolean? enable/disable pre-create file notifications
53-
---@field willRename boolean? enable/disable pre-rename file notifications
51+
---@field willCreate boolean? enable/disable pre-create file requests
52+
---@field willDelete boolean? enable/disable pre-delete file requests
53+
---@field willRename boolean? enable/disable pre-rename file requests
5454
---@field didCreate boolean? enable/disable post-create file notifications
55-
---@field didDelete boolean? enable/disable post-create file notifications
55+
---@field didDelete boolean? enable/disable post-delete file notifications
5656
---@field didRename boolean? enable/disable post-rename file notifications
5757

5858
---@class AstroLSPFileOperationsOpts
@@ -166,12 +166,12 @@
166166
--- timeout = 10000,
167167
--- -- fully disable/enable file operation methods
168168
--- operations = {
169-
--- willRenameFiles = true,
170-
--- didRenameFiles = true,
171-
--- willCreateFiles = true,
172-
--- didCreateFiles = true,
173-
--- willDeleteFiles = true,
174-
--- didDeleteFiles = true,
169+
--- willRename = true,
170+
--- didRename = true,
171+
--- willCreate = true,
172+
--- didCreate = true,
173+
--- willDelete = true,
174+
--- didDelete = true,
175175
--- }
176176
--- }
177177
---```

‎lua/astrolsp/file_operations.lua‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ local function getWorkspaceEdit(client, req, params, timeout)
124124
if resp and resp.result then return resp.result end
125125
end
126126

127-
--- Notify LSP clients that file(s) are going to be created
127+
--- Request workspace edits from LSP clients before file(s) are created
128128
---@param fnames string|string[] a file or list of files that will be created
129129
function M.willCreateFiles(fnames)
130130
local config = get_config()
@@ -148,7 +148,7 @@ function M.willCreateFiles(fnames)
148148
end
149149
end
150150

151-
--- Notify LSP clients that file(s) are going to be deleted
151+
--- Request workspace edits from LSP clients before file(s) are deleted
152152
---@param fnames string|string[] a file or list of files that will be deleted
153153
function M.willDeleteFiles(fnames)
154154
local config = get_config()
@@ -172,7 +172,7 @@ function M.willDeleteFiles(fnames)
172172
end
173173
end
174174

175-
--- Notify LSP clients that file(s) are going to be renamed
175+
--- Request workspace edits from LSP clients before file(s) are renamed
176176
---@param renames AstroLSPFileOperationsRename|AstroLSPFileOperationsRename[] a table or list of tables of files that will be renamed
177177
function M.willRenameFiles(renames)
178178
local config = get_config()

‎lua/astrolsp/toggles.lua‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ local function ui_notify(silent, ...) return not silent and vim.notify(...) end
1515
local function bool2str(bool) return bool and "on" or "off" end
1616

1717
--- Toggle auto format
18-
---@param silent? boolean if true then don't sent a notification
18+
---@param silent? boolean if true then don't send a notification
1919
function M.autoformat(silent)
2020
local format_on_save = get_config().formatting.format_on_save --[[@as AstroLSPFormatOnSaveOpts]]
2121
format_on_save.enabled = not format_on_save.enabled
@@ -24,7 +24,7 @@ end
2424

2525
--- Toggle buffer local auto format
2626
---@param bufnr? integer The buffer to toggle the autoformatting of, default the current buffer
27-
---@param silent? boolean if true then don't sent a notification
27+
---@param silent? boolean if true then don't send a notification
2828
function M.buffer_autoformat(bufnr, silent)
2929
bufnr = bufnr or 0
3030
local old_val = vim.b[bufnr].autoformat
@@ -38,7 +38,7 @@ end
3838

3939
--- Toggle buffer LSP inlay hints
4040
---@param bufnr? integer the buffer to toggle the clients on
41-
---@param silent? boolean if true then don't sent a notification
41+
---@param silent? boolean if true then don't send a notification
4242
function M.buffer_inlay_hints(bufnr, silent)
4343
if vim.lsp.inlay_hint then
4444
local filter = { bufnr = bufnr or 0 }
@@ -48,7 +48,7 @@ function M.buffer_inlay_hints(bufnr, silent)
4848
end
4949

5050
--- Toggle global LSP inlay hints
51-
---@param silent? boolean if true then don't sent a notification
51+
---@param silent? boolean if true then don't send a notification
5252
function M.inlay_hints(silent)
5353
if vim.lsp.inlay_hint then
5454
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
@@ -58,7 +58,7 @@ end
5858

5959
--- Toggle buffer semantic token highlighting for all language servers that support it
6060
---@param bufnr? integer the buffer to toggle the clients on
61-
---@param silent? boolean if true then don't sent a notification
61+
---@param silent? boolean if true then don't send a notification
6262
function M.buffer_semantic_tokens(bufnr, silent)
6363
bufnr = bufnr or 0
6464
if vim.lsp.semantic_tokens.enable then
@@ -83,7 +83,7 @@ function M.buffer_semantic_tokens(bufnr, silent)
8383
end
8484

8585
--- Toggle global semantic token highlighting for all language servers that support it
86-
---@param silent? boolean if true then don't sent a notification
86+
---@param silent? boolean if true then don't send a notification
8787
function M.semantic_tokens(silent)
8888
if not vim.lsp.semantic_tokens.enable then
8989
ui_notify(silent, "Only available in Neovim v0.12+", vim.log.levels.WARN)
@@ -96,7 +96,7 @@ end
9696

9797
--- Toggle buffer codelens
9898
---@param bufnr? integer the buffer to toggle the clients on
99-
---@param silent? boolean if true then don't sent a notification
99+
---@param silent? boolean if true then don't send a notification
100100
function M.buffer_codelens(bufnr, silent)
101101
bufnr = bufnr or 0
102102
if not vim.lsp.codelens.enable then
@@ -108,7 +108,7 @@ function M.buffer_codelens(bufnr, silent)
108108
end
109109

110110
--- Toggle global codelens
111-
---@param silent? boolean if true then don't sent a notification
111+
---@param silent? boolean if true then don't send a notification
112112
function M.codelens(silent)
113113
-- TODO: remove check when dropping support for Neovim v0.11
114114
if vim.lsp.codelens.enable then
@@ -123,7 +123,7 @@ function M.codelens(silent)
123123
end
124124

125125
--- Toggle automatic signature help
126-
---@param silent? boolean if true then don't sent a notification
126+
---@param silent? boolean if true then don't send a notification
127127
function M.signature_help(silent)
128128
local config = get_config()
129129
config.features.signature_help = not config.features.signature_help
@@ -132,7 +132,7 @@ end
132132

133133
--- Toggle buffer local automatic signature help
134134
---@param bufnr? integer The buffer to toggle the auto signature help of, default the current buffer
135-
---@param silent? boolean if true then don't sent a notification
135+
---@param silent? boolean if true then don't send a notification
136136
function M.buffer_signature_help(bufnr, silent)
137137
bufnr = bufnr or 0
138138
local config = get_config()

0 commit comments

Comments
 (0)