Skip to content

JSONPath Tools / @jsonpath-tools/jsonpath / CompletionService

Class: CompletionService ​

Provides completion items.

Constructors ​

Constructor ​

ts
new CompletionService(queryOptions): CompletionService;

Parameters ​

queryOptions ​

QueryOptions

Query options.

Returns ​

CompletionService

Methods ​

provideCompletions() ​

ts
provideCompletions(
   query, 
   queryArgument, 
   queryArgumentType, 
   position): CompletionItem[];

Provides completion items at the given caret position in the query text.

Parameters ​

query ​

Query

Query.

queryArgument ​

JSONValue | undefined

Query argument.

queryArgumentType ​

DataType

Query argument type.

position ​

number

Caret position in the query text (starts with 0).

Returns ​

CompletionItem[]