115void rankSnippets(std::vector<StatementSnippet>& snippets,
const std::string& prefix);
140 int& caretLine,
int& caretCol);
void expandSnippet(const StatementSnippet &snippet, const std::string &base, const std::string &tab, std::string &text, int &caretLine, int &caretCol)
Write a snippet out at a line, in the indentation already in force there.
std::string statementPrefixAt(const std::string &line, int column, int &startCol)
The word being typed at the caret.
std::string leadingWhitespace(const std::string &line)
Indentation of a line, spaces and tabs alike.
bool hasStatementPrefix(const std::string &prefix)
Whether the list is worth opening for what has been typed.
SnippetPane
The pane a snippet is written into.
Definition undoAppSTSnippet.hpp:34
@ Variables
The Variables pane, which holds the VAR sections.
@ Body
The Body pane, which holds the cyclic code.
void rankSnippets(std::vector< StatementSnippet > &snippets, const std::string &prefix)
Keep the snippets matching a prefix, best match first.
std::vector< StatementSnippet > snippetsForPane(SnippetPane pane)
The snippets belonging to one pane.
const std::vector< StatementSnippet > & allStatementSnippets()
The statements on offer.
Definition undoAppCpp.hpp:26
One statement skeleton the suggestion list can write out.
Definition undoAppSTSnippet.hpp:53
int caretLine
Template line the caret lands on.
Definition undoAppSTSnippet.hpp:59
std::string label
What the list shows, e.g. "IF ... END_IF".
Definition undoAppSTSnippet.hpp:54
std::string detail
Dimmed right-hand column: what it is for.
Definition undoAppSTSnippet.hpp:55
SnippetPane pane
Definition undoAppSTSnippet.hpp:57
int caretColumn
Caret column, before the base indentation.
Definition undoAppSTSnippet.hpp:60
std::string insert
Keyword written when the skeleton is accepted.
Definition undoAppSTSnippet.hpp:56
std::vector< std::string > lines
Template lines, "\t" for one indent step.
Definition undoAppSTSnippet.hpp:58