Answer class

Constructors

Answer({bool? cold, List<Completion> completions = const [], List<Diagnostic> diagnostics = const [], String? hover, String? lang, List<Location> locations = const [], String? op, String? path, String? repo, String? rev, List<CodeSymbol> symbols = const []})
Returns a new Answer instance.

Properties

cold ↔ bool?
Cold reports that this request paid to PREPARE the revision — the tree write, the dependency fetch and the language server's first index. It is the billed event, surfaced so a caller can see what it was charged for.
getter/setter pair
completions ↔ List<Completion>
Completions is complete's answer: the candidates at the position, typed and resolved through the repository's dependencies rather than guessed from text.
getter/setter pair
diagnostics ↔ List<Diagnostic>
Diagnostics is diagnostics' answer: every problem the server finds in the whole file, position ignored. Empty means it found none.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
hover ↔ String?
Hover is hover's answer: the type and documentation as the language server itself renders them, so it is prose meant to be shown, not parsed.
getter/setter pair
lang ↔ String?
Lang is the language the server that answered speaks ("go"), as the daemon reports it. Empty when the daemon named none.
getter/setter pair
locations ↔ List<Location>
Locations is locate's answer: where the symbol is defined, referenced, typed or implemented, per the relation asked for. Empty means the server resolved nothing there, which is an answer.
getter/setter pair
op ↔ String?
Op is the question that was asked: hover, locate, symbols, diagnostics or complete. It names which result field below is the populated one.
getter/setter pair
path ↔ String?
Path is the repo-relative file the question was about, echoed back.
getter/setter pair
repo ↔ String?
Repo is the repository the question was about, echoed back.
getter/setter pair
rev ↔ String?
Rev is the RESOLVED commit sha, never the branch or tag that was asked for. It is what makes an answer re-askable: a branch moves, this does not.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
symbols ↔ List<CodeSymbol>
Symbols is symbols' answer: the file's whole outline, position ignored.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → Answer?
Returns a new Answer instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<Answer>
mapFromJson(dynamic json) → Map<String, Answer>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<Answer>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.