Back to Beekeeper Studio

Language Server Helpers API

apps/ui-kit/docs/api/language-server-helpers.md

5.7.23.2 KB
Original Source

Language Server Helpers API

Methods

NameDescriptionArgumentsReturn Value
getClient()Returns the language server client instance-LanguageServerClient
formatDocument()Formats the entire documentoptions: LSP.FormattingOptions
formatDocumentRange()Formats a specific range in the documentrange: LSP.Range, options: LSP.FormattingOptions
requestSemanticTokens()Requests semantic tokens for highlighting and apply them to the document. Returns the result ID.lastResultId?: stringstring

LSP.FormattingOptions

PropertyTypeDescription
tabSizeuintegerSize of a tab in spaces.
insertSpacesbooleanPrefer spaces over tabs.
trimTrailingWhitespaceboolean?Trim trailing whitespace on a line.
insertFinalNewlineboolean?Insert a newline at the end of the file if one does not exist.
trimFinalNewlinesboolean?Trim all newlines after the final newline at the end of the file.
[key: string]boolean | integer | string | undefinedSignature for further properties.

LSP.Range

PropertyTypeDescription
startLSP.PositionStart position (zero-based).
endLSP.PositionEnd position (zero-based). To include the line ending, use the start of the next line as the end point.

LSP.Position

PropertyTypeDescription
linenumberLine number (zero-based).
characternumberCharacter offset (zero-based).