feat(lsp): add vim.lsp.buf.format (#18193)

This commit is contained in:
Michael Lingelbach
2022-04-30 06:36:40 -07:00
committed by GitHub
parent eecc6535eb
commit 5b04e46d23
5 changed files with 220 additions and 21 deletions

View File

@@ -1873,7 +1873,7 @@ end
--- Returns indentation size.
---
---@see |shiftwidth|
---@param bufnr (optional, number): Buffer handle, defaults to current
---@param bufnr (number|nil): Buffer handle, defaults to current
---@returns (number) indentation size
function M.get_effective_tabstop(bufnr)
validate { bufnr = {bufnr, 'n', true} }
@@ -1884,7 +1884,7 @@ end
--- Creates a `DocumentFormattingParams` object for the current buffer and cursor position.
---
---@param options Table with valid `FormattingOptions` entries
---@param options table|nil with valid `FormattingOptions` entries
---@returns `DocumentFormattingParams` object
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting
function M.make_formatting_params(options)