CompletionSuggestion class
CompletionSuggestion
{ "kind": CompletionSuggestionKind "relevance": int "completion": String "displayText": optional String "replacementOffset": optional int "replacementLength": optional int "selectionOffset": int "selectionLength": int "isDeprecated": bool "isPotential": bool "docSummary": optional String "docComplete": optional String "declaringType": optional String "defaultArgumentListString": optional String "defaultArgumentListTextRanges": optional List
Clients may not extend, implement or mix-in this class.
Constructors
-
CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String completion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPotential, {String? displayText, int? replacementOffset, int? replacementLength, String? docSummary, String? docComplete, String? declaringType, String? defaultArgumentListString, List<
int> ? defaultArgumentListTextRanges, Element? element, String? returnType, List<String> ? parameterNames, List<String> ? parameterTypes, int? requiredParameterCount, bool? hasNamedParameters, String? parameterName, String? parameterType, String? libraryUri, bool? isNotImported}) - CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object? json)
-
factory
Properties
- completion ↔ String
-
The identifier to be inserted if the suggestion is selected. If the
suggestion is for a method or function, the client might want to
additionally insert a template for the parameters. The information
required in order to do so is contained in other fields.
getter/setter pair
- declaringType ↔ String?
-
The class that declares the element being suggested. This field is
omitted if the suggested element is not a member of a class.
getter/setter pair
- defaultArgumentListString ↔ String?
-
A default String for use in generating argument list source contents on
the client side.
getter/setter pair
-
defaultArgumentListTextRanges
↔ List<
int> ? -
Pairs of offsets and lengths describing 'defaultArgumentListString' text
ranges suitable for use by clients to set up linked edits of default
argument source contents. For example, given an argument list string 'x,
y', the corresponding text range
0, 1, 3, 1
, indicates two text ranges of length 1, starting at offsets 0 and 3. Clients can use these ranges to treat the 'x' and 'y' values specially for linked edits.getter/setter pair - displayText ↔ String?
-
Text to be displayed in, for example, a completion pop-up. This field is
only defined if the displayed text should be different than the
completion. Otherwise it is omitted.
getter/setter pair
- docComplete ↔ String?
-
The Dartdoc associated with the element being suggested. This field is
omitted if there is no Dartdoc associated with the element.
getter/setter pair
- docSummary ↔ String?
-
An abbreviated version of the Dartdoc associated with the element being
suggested. This field is omitted if there is no Dartdoc associated with
the element.
getter/setter pair
- element ↔ Element?
-
Information about the element reference being suggested.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasNamedParameters ↔ bool?
-
True if the function or method being suggested has at least one named
parameter. This field is omitted if the parameterNames field is omitted.
getter/setter pair
- isDeprecated ↔ bool
-
True if the suggested element is deprecated.
getter/setter pair
- isNotImported ↔ bool?
-
True if the suggestion is for an element from a not yet imported library.
This field is omitted if the element is declared locally, or is from
library is already imported, so that the suggestion can be inserted as
is, or if getSuggestions was used rather than getSuggestions2.
getter/setter pair
- isPotential ↔ bool
-
True if the element is not known to be valid for the target. This happens
if the type of the target is dynamic.
getter/setter pair
- kind ↔ CompletionSuggestionKind
-
The kind of element being suggested.
getter/setter pair
- libraryUri ↔ String?
-
This field is omitted if getSuggestions was used rather than
getSuggestions2.
getter/setter pair
- parameterName ↔ String?
-
The name of the optional parameter being suggested. This field is omitted
if the suggestion is not the addition of an optional argument within an
argument list.
getter/setter pair
-
parameterNames
↔ List<
String> ? -
The names of the parameters of the function or method being suggested.
This field is omitted if the suggested element is not a setter, function
or method.
getter/setter pair
- parameterType ↔ String?
-
The type of the options parameter being suggested. This field is omitted
if the parameterName field is omitted.
getter/setter pair
-
parameterTypes
↔ List<
String> ? -
The types of the parameters of the function or method being suggested.
This field is omitted if the parameterNames field is omitted.
getter/setter pair
- relevance ↔ int
-
The relevance of this completion suggestion where a higher number
indicates a higher relevance.
getter/setter pair
- replacementLength ↔ int?
-
The length of the text to be replaced. If supplied, this should be used
in preference to the offset provided on the containing completion
results. This value may be provided independently of replacementOffset
(for example if only one differs from the completion result value).
getter/setter pair
- replacementOffset ↔ int?
-
The offset of the start of the text to be replaced. If supplied, this
should be used in preference to the offset provided on the containing
completion results. This value may be provided independently of
replacementLength (for example if only one differs from the completion
result value).
getter/setter pair
- requiredParameterCount ↔ int?
-
The number of required parameters for the function or method being
suggested. This field is omitted if the parameterNames field is omitted.
getter/setter pair
- returnType ↔ String?
-
The return type of the getter, function or method or the type of the
field being suggested. This field is omitted if the suggested element is
not a getter, function or method.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionLength ↔ int
-
The number of characters that should be selected after insertion.
getter/setter pair
- selectionOffset ↔ int
-
The offset, relative to the beginning of the completion, of where the
selection should be placed after insertion.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object> - Returns a JSON presentation of the object.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override