docs(lsp): use direct link to formattingOptions in format docs (#19558)

Also changes `@see` to `See` to avoid the break to a dedicated "See
also" block in the generated vimdoc
This commit is contained in:
Mathias Fußenegger 2022-07-28 19:41:30 +02:00 committed by GitHub
parent 98915f88b2
commit b25abbf4b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 21 deletions

View File

@ -1202,32 +1202,33 @@ format({options}) *vim.lsp.buf.format()*
• formatting_options (table|nil): Can be used • formatting_options (table|nil): Can be used
to specify FormattingOptions. Some to specify FormattingOptions. Some
unspecified options will be automatically unspecified options will be automatically
derived from the current Neovim options. derived from the current Neovim options. See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#formattingOptions
• timeout_ms (integer|nil, default 1000): Time
See also: ~ in milliseconds to block for formatting
https://microsoft.github.io/language-server-protocol/specification#textDocument_formatting requests. No effect if async=true
• timeout_ms (integer|nil, default 1000): Time in • bufnr (number|nil): Restrict formatting to
milliseconds to block for formatting requests. No effect the clients attached to the given buffer,
if async=true defaults to the current buffer (0).
• bufnr (number|nil): Restrict formatting to the clients • filter (function|nil): Predicate used to
attached to the given buffer, defaults to the current filter clients. Receives a client as argument
buffer (0). and must return a boolean. Clients matching
• filter (function|nil): Predicate used to filter clients. the predicate are included. Example: • >
Receives a client as argument and must return a boolean.
Clients matching the predicate are included. Example: • >
-- Never request typescript-language-server for formatting -- Never request typescript-language-server for formatting
vim.lsp.buf.format { vim.lsp.buf.format {
filter = function(client) return client.name ~= "tsserver" end filter = function(client) return client.name ~= "tsserver" end
} }
< <
• async boolean|nil If true the method won't block. • async boolean|nil If true the method won't
Defaults to false. Editing the buffer while formatting block. Defaults to false. Editing the buffer
asynchronous can lead to unexpected changes. while formatting asynchronous can lead to
• id (number|nil): Restrict formatting to the client with unexpected changes.
ID (client.id) matching this field. • id (number|nil): Restrict formatting to the
• name (string|nil): Restrict formatting to the client client with ID (client.id) matching this
with name (client.name) matching this field. field.
• name (string|nil): Restrict formatting to the
client with name (client.name) matching this
field.
formatting({options}) *vim.lsp.buf.formatting()* formatting({options}) *vim.lsp.buf.formatting()*
Formats the current buffer. Formats the current buffer.

View File

@ -157,7 +157,7 @@ end
--- - formatting_options (table|nil): --- - formatting_options (table|nil):
--- Can be used to specify FormattingOptions. Some unspecified options will be --- Can be used to specify FormattingOptions. Some unspecified options will be
--- automatically derived from the current Neovim options. --- automatically derived from the current Neovim options.
--- @see https://microsoft.github.io/language-server-protocol/specification#textDocument_formatting --- See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#formattingOptions
--- - timeout_ms (integer|nil, default 1000): --- - timeout_ms (integer|nil, default 1000):
--- Time in milliseconds to block for formatting requests. No effect if async=true --- Time in milliseconds to block for formatting requests. No effect if async=true
--- - bufnr (number|nil): --- - bufnr (number|nil):