JSONPath Tools / @jsonpath-tools/jsonpath / EditorService
Class: EditorService
Provides services for JSONPath editors.
Constructors
new EditorService()
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): null | Signature
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
null
| Signature
getTooltip()
getTooltip(position): null | Tooltip
Provides 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): 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
New query argument.
undefined
| JSONValue
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.