CompletionSuggestion class
A suggestion for how to complete partially entered text. Many of the fields are optional, depending on the kind of element being suggested.
- Implemented types
Constructors
-
CompletionSuggestion(String 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})
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.
final
- 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.
final
- defaultArgumentListString → String?
-
A default String for use in generating argument list source contents on
the client side.
final
-
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.final - 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.
final
- docComplete → String?
-
The Dartdoc associated with the element being suggested. This field is
omitted if there is no Dartdoc associated with the element.
final
- 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.
final
- element → Element?
-
Information about the element reference being suggested.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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.
final
- isDeprecated → bool
-
True if the suggested element is deprecated.
final
- 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 thangetSuggestions2
.final - 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.
final
- kind → String
-
The kind of element being suggested.
final
- libraryUri → String?
-
This field is omitted if
getSuggestions
was used rather thangetSuggestions2
.final - 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.
final
-
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.
final
- parameterType → String?
-
The type of the options parameter being suggested. This field is omitted
if the parameterName field is omitted.
final
-
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.
final
- relevance → int
-
The relevance of this completion suggestion where a higher number
indicates a higher relevance.
final
- 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).
final
- 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).
final
- requiredParameterCount → int?
-
The number of required parameters for the function or method being
suggested. This field is omitted if the parameterNames field is omitted.
final
- 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.
final
- 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.
final
- selectionOffset → int
-
The offset, relative to the beginning of the completion, of where the
selection should be placed after insertion.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
parse(
Map m) → CompletionSuggestion