The tabSize field in the LSP spec is poorly named, as it's not used for
anything tab related but rather the indent size when formatting. This
corresponds to shiftwidth() in Vim.
# interface DocumentFormattingParams
# interface TextDocumentIdentifier
- var tabsz: number
- if &sts > 0
- tabsz = &sts
- elseif &sts < 0
- tabsz = &shiftwidth
- else
- tabsz = &tabstop
- endif
# interface FormattingOptions
var fmtopts: dict<any> = {
- tabSize: tabsz,
+ tabSize: shiftwidth(),
insertSpaces: &expandtab ? true : false,
}
#req.params->extend({textDocument: {uri: util.LspFileToUri(fname)},