JSONPath Tools / @jsonpath-tools/jsonpath / EditorService
Class: EditorService
Provides services for JSONPath editors.
Constructors
Constructor
new EditorService(): EditorService;Returns
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(): NodeList;Returns the query result (selected nodes).
Returns
getSignature()
getSignature(position): Signature | null;Provides 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
Signature | null
getTooltip()
getTooltip(position): Tooltip | null;Provides a tooltip at the given position in the query text.
Parameters
position
number
Position in the query text (character index).
Returns
Tooltip | null
updateQuery()
updateQuery(newQuery): void;Updates edited query text.
Parameters
newQuery
string
New text of the edited query.
Returns
void
See
updateQueryPartial for partial update.
updateQueryArgument()
updateQueryArgument(newQueryArgument): void;Updates query argument.
Parameters
newQueryArgument
JSONValue | undefined
New query argument.
Returns
void
updateQueryArgumentType()
updateQueryArgumentType(newQueryArgumentType): void;Updates query argument type.
Parameters
newQueryArgumentType
New query argument type.
Returns
void
updateQueryOptions()
updateQueryOptions(newQueryOptions): void;Updates query options.
Parameters
newQueryOptions
New query options.
Returns
void
updateQueryPartial()
updateQueryPartial(queryTextChanges): void;Updates 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.