17#ifndef A11_FLOW_COMPLETE_H_
18#define A11_FLOW_COMPLETE_H_
151 std::string_view source,
size_t offset,
Everything the tools know about the world, in one place.
Definition catalogue.h:119
static const Catalogue & Builtin()
The embedded snapshot: what a standalone tool knows with nothing configured.
Definition catalogue.cc:424
Definition boundary.cc:32
ProposalKind
What a proposal is, which is what an editor turns into an icon.
Definition complete.h:35
@ kConstant
true, false, null, it.
@ kPort
A port of this flow, or of a call.
@ kDeclaration
A word that declares something: in, header, describe.
@ kStatement
A word that opens a statement: run, wait, for.
@ kCall
A bound run/call step.
@ kField
A field of something: a status's code, a node's id.
@ kLogLevel
A log level, as log and logf name one.
@ kStage
A pipeline stage, offered after a |.
@ kHeader
A header, under its alias.
@ kModifier
A word that follows a call: tee, timeout, forward headers.
@ kNode
A node of the flow's own.
@ kFunction
One of the fixed functions.
@ kFlow
A flow of this file, offered as a call target.
@ kStatusCode
A canonical status code, as fail names one.
@ kPortModifier
What a port says about itself: stream, required.
@ kVariable
A loop variable, the index a loop binds, or what a repeat carries.
@ kBarrier
A bound wait/drain.
CompleteResult CompleteAt(std::string_view source, size_t offset, const catalogue::Catalogue &known)
What may be written at offset in source.
Definition complete.cc:1461
constexpr std::string_view kCompletionsFormat
The format field of the completions envelope.
Definition complete.h:158
std::string_view ProposalKindName(ProposalKind kind)
The name of a proposal kind in the output format, in kebab case.
Definition complete.cc:1476
What may be written at an offset, and the word already typed there.
Definition complete.h:108
std::string prefix
The partial word the caret is in, if any.
Definition complete.h:113
std::vector< Proposal > proposals
Definition complete.h:109
size_t prefix_start
Where that word starts, so an editor knows what a proposal replaces.
Definition complete.h:122
One thing that may be written at an offset.
Definition complete.h:77
std::string tail
Grey text an editor shows after the name: what a stage takes, whether a port is required.
Definition complete.h:91
std::string type
The type of the thing proposed, where it has one: a port's declared type.
Definition complete.h:93
ProposalKind kind
Definition complete.h:80
int caret
Where the caret lands inside insert, in bytes.
Definition complete.h:88
std::string documentation
The whole of what is known about it, as Markdown, for the popup an editor shows beside the list.
Definition complete.h:104
std::string insert
The text to insert, which is name unless taking it writes more: a function takes its parentheses,...
Definition complete.h:84
std::string name
The word, as it would be read back: truncate, x.question.
Definition complete.h:79
long long offset
Definition main.cc:69