CompletionEntry

sealed external interface CompletionEntry(source)

Properties

Link copied to clipboard
abstract var commitCharacters: <Error class: unknown class><String>?

If this completion entry is selected, typing a commit character will cause the entry to be accepted.

Link copied to clipboard
abstract var data: CompletionEntryData?

A property to be sent back to TS Server in the CompletionDetailsRequest, along with name, that allows TS Server to look up the symbol represented by the completion item, disambiguating items with the same name. Currently only defined for auto-import completions, but the type is unknown in the protocol, so it can be changed as needed to support other kinds of completions. The presence of this property should generally not be used to assume that this completion entry is an auto-import.

Link copied to clipboard
abstract var filterText: String?

A string that should be used when filtering a set of completion items.

Link copied to clipboard
abstract var hasAction: Boolean?

Indicates whether commiting this completion entry will require additional code actions to be made to avoid errors. The CompletionEntryDetails will have these actions.

Link copied to clipboard
abstract var insertText: String?

Text to insert instead of name. This is used to support bracketed completions; If name might be "a-b" but insertText would be ["a-b"], coupled with replacementSpan to replace a dotted access with a bracket access.

Link copied to clipboard

If true, this completion was generated from traversing the name table of an unchecked JS file, and therefore may not be accurate.

Link copied to clipboard

If true, this completion was an auto-import-style completion of an import statement (i.e., the module specifier was inserted along with the imported identifier). Used for telemetry reporting.

Link copied to clipboard

If true, this completion was for an auto-import of a module not yet in the program, but listed in the project package.json. Used for telemetry reporting.

Link copied to clipboard
abstract var isRecommended: Boolean?

If true, this completion should be highlighted as recommended. There will only be one of these. This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class. Then either that enum/class or a namespace containing it will be the recommended symbol.

Link copied to clipboard
abstract var isSnippet: Boolean?

insertText should be interpreted as a snippet if true.

Link copied to clipboard
abstract var kind: ScriptElementKind
Link copied to clipboard
abstract var kindModifiers: String?
Link copied to clipboard

Additional details for the label.

Link copied to clipboard
abstract var name: String
Link copied to clipboard
abstract var replacementSpan: TextSpan?

An optional span that indicates the text to be replaced by this completion item. If present, this span should be used instead of the default one. It will be set if the required span differs from the one generated by the default replacement behavior.

Link copied to clipboard
abstract var sortText: String

A string that is used for comparing completion items so that they can be ordered. This is often the same as the name but may be different in certain circumstances.

Link copied to clipboard
abstract var source: String?

Identifier (not necessarily human-readable) identifying where this completion came from.

Link copied to clipboard
abstract var sourceDisplay: <Error class: unknown class><SymbolDisplayPart>?

Human-readable description of the source.

Link copied to clipboard
abstract var symbol: Symbol?

For API purposes. Included for non-string completions only when includeSymbol: true option is passed to getCompletionsAtPosition.