Skip to content

JSONPath Tools / @jsonpath-tools/jsonpath / CompletionItem

Class: CompletionItem

Completion item.

Constructors

new CompletionItem()

ts
new CompletionItem(
   type, 
   text, 
   range, 
   label, 
   detail?, 
   resolveDescription?, 
   textType?): CompletionItem

Parameters

type

CompletionItemType

Type.

text

string

Text to be inserted instead of range.

When textType is CompletionItemTextType.snippet it should be inserted as a snippet. Snippet parts are defined using ${}, for example ${start}:${end}:${step}.

range

TextRange

Text range to be replaced with text.

label

string = text

Text to display in user interface.

detail?

string

Additional text to show next to label in user interface. For example a type.

resolveDescription?

() => string

Function that computes the long description. In Markdown format.

textType?

CompletionItemTextType = CompletionItemTextType.plain

Whether the text should be inserted as is or as a snippet.

Returns

CompletionItem

Properties

detail?

ts
readonly optional detail: string;

Additional text to show next to label in user interface. For example a type.


label

ts
readonly label: string = text;

Text to display in user interface.


range

ts
readonly range: TextRange;

Text range to be replaced with text.


resolveDescription()?

ts
readonly optional resolveDescription: () => string;

Function that computes the long description. In Markdown format.

Returns

string


text

ts
readonly text: string;

Text to be inserted instead of range.

When textType is CompletionItemTextType.snippet it should be inserted as a snippet. Snippet parts are defined using ${}, for example ${start}:${end}:${step}.


textType

ts
readonly textType: CompletionItemTextType = CompletionItemTextType.plain;

Whether the text should be inserted as is or as a snippet.


type

ts
readonly type: CompletionItemType;

Type.