JSONPath Tools / @jsonpath-tools/jsonpath / EditorService
Class: EditorService
Provides services for JSONPath editors.
Constructors
new EditorService()
new EditorService(): EditorServiceReturns
EditorService
Methods
getCompletions()
getCompletions(position): CompletionItem[]Provides completion items at the given caret position in the query text.
Parameters
position
number
Caret position in the query text (starts with 0).
Returns
getDiagnostics()
getDiagnostics(): Diagnostics[]Provides the query errors and warnings.
Returns
getDocumentHighlights()
getDocumentHighlights(position): DocumentHighlight[]Provides document highlights at the given caret position in the query text.
Parameters
position
number
Caret position in the query text (starts with 0).
Returns
getFormattingEdits()
getFormattingEdits(): TextChange[]Provides text changes that can be used to format the query text.
Returns
getResult()
getResult(): NodeListReturns the query result (selected nodes).
Returns
getSignature()
getSignature(position): null | SignatureProvides a signature at the given caret position in the query text. When no signature is available it returns null.
Parameters
position
number
Caret position in the query text (starts with 0).
Returns
null | Signature
getTooltip()
getTooltip(position): null | TooltipProvides a tooltip at the given position in the query text.
Parameters
position
number
Position in the query text (character index).
Returns
null | Tooltip
updateQuery()
updateQuery(newQuery): voidUpdates edited query text.
Parameters
newQuery
string
New text of the edited query.
Returns
void
See
updateQueryPartial for partial update.
updateQueryArgument()
updateQueryArgument(newQueryArgument): voidUpdates query argument.
Parameters
newQueryArgument
New query argument.
undefined | JSONValue
Returns
void
updateQueryArgumentType()
updateQueryArgumentType(newQueryArgumentType): voidUpdates query argument type.
Parameters
newQueryArgumentType
New query argument type.
Returns
void
updateQueryOptions()
updateQueryOptions(newQueryOptions): voidUpdates query options.
Parameters
newQueryOptions
New query options.
Returns
void
updateQueryPartial()
updateQueryPartial(queryTextChanges): voidUpdates part of edited query text.
Parameters
queryTextChanges
readonly TextChange[]
Text changes that should be applied to the edited query text.
Returns
void
See
updateQuery for full update.