Class CompletionSite
- Namespace
- RDCore.SDK.Model.Symbols.Completion
- Assembly
- RDCore.SDK.dll
What is being written where a completion list is asked for: read off the text of the line before the cursor, which is what is known for sure of code that is being typed - the rest of it need not parse, and usually does not.
public sealed record CompletionSite : IEquatable<CompletionSite>
- Inheritance
-
CompletionSite
- Implements
- Inherited Members
Constructors
CompletionSite(CompletionSiteKind, string, string, bool, string)
What is being written where a completion list is asked for: read off the text of the line before the cursor, which is what is known for sure of code that is being typed - the rest of it need not parse, and usually does not.
public CompletionSite(CompletionSiteKind Kind, string Prefix = "", string Qualifier = "", bool IsStatementStart = false, string Statement = "")
Parameters
KindCompletionSiteKindWhat is offered.
PrefixstringThe part of the name that is typed already, which the list is narrowed to: what a chosen item replaces. For a name being written in brackets, it starts with the opening bracket (
[My Fi).QualifierstringFor Member, the expression before the
., as it is written (Foo.Bar(1)); an empty string for a member access with no expression before it, which is a member of the object of the enclosingWithblock (MS-VBAL §5.4.2.21), and one that starts with a.for a member of a member of that object (.Items(1)). For a qualified type name (As VBA.Collection), the qualifier of it. Empty otherwise.IsStatementStartboolWhether the name is the first thing of a statement, where a statement keyword can be written.
StatementstringFor Name and Type, the statement the name is written in, up to the name: what decides which names and keywords can be written there (CompletionStatement). Empty where a statement starts.
Properties
Expectation
What comes next in Statement: a statement, an operand, or an operator.
public CompletionExpectation Expectation { get; }
Property Value
IsStatementStart
Whether the name is the first thing of a statement, where a statement keyword can be written.
public bool IsStatementStart { get; init; }
Property Value
Kind
What is offered.
public CompletionSiteKind Kind { get; init; }
Property Value
Prefix
The part of the name that is typed already, which the list is narrowed to: what a chosen item replaces. For a name being written in brackets, it starts
with the opening bracket ([My Fi).
public string Prefix { get; init; }
Property Value
Qualifier
For Member, the expression before the ., as it is written (Foo.Bar(1)); an empty string for a member access
with no expression before it, which is a member of the object of the enclosing With block (MS-VBAL §5.4.2.21), and one that starts
with a . for a member of a member of that object (.Items(1)). For a qualified type
name (As VBA.Collection), the qualifier of it. Empty otherwise.
public string Qualifier { get; init; }
Property Value
Statement
For Name and Type, the statement the name is written in, up to the name: what decides which names and keywords can be written there (CompletionStatement). Empty where a statement starts.
public string Statement { get; init; }
Property Value
Tokens
The tokens of Statement.
public IReadOnlyList<string> Tokens { get; }
Property Value
Methods
Read(string)
Reads what is being written at the end of text.
public static CompletionSite Read(string text)
Parameters
textstringThe text of the line, up to the cursor.
Returns
Remarks
A name written after a ! is the name of a dictionary access (MS-VBAL §5.6.14): a string the object's default member is given
when the code runs, which no declaration names. Nothing is completed there (None), and nothing is completed right after
a ! that is the type suffix of a Single (x!) either, since no name follows one. A ! written in the expression a member is
accessed on is part of that expression (Sheets![My Sheet].Ra).
A name written in brackets (MS-VBAL §3.3.5.3 foreign-name) holds any character of the line but a ]: where its opening
bracket is not closed yet, the name is being typed from it, and the prefix is the bracket and what follows it (x = [My Fi).