Table of Contents

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

Kind CompletionSiteKind

What is offered.

Prefix string

The part of the name that is typed already, which the list is narrowed to: what a chosen item replaces.

Qualifier string

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.

IsStatementStart bool

Whether the name is the first thing of a statement, where a statement keyword can be written.

Statement string

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.

Properties

Expectation

What comes next in Statement: a statement, an operand, or an operator.

public CompletionExpectation Expectation { get; }

Property Value

CompletionExpectation

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

bool

Kind

What is offered.

public CompletionSiteKind Kind { get; init; }

Property Value

CompletionSiteKind

Prefix

The part of the name that is typed already, which the list is narrowed to: what a chosen item replaces.

public string Prefix { get; init; }

Property Value

string

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

string

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

string

Tokens

The tokens of Statement.

public IReadOnlyList<string> Tokens { get; }

Property Value

IReadOnlyList<string>

Methods

Read(string)

Reads what is being written at the end of text.

public static CompletionSite Read(string text)

Parameters

text string

The text of the line, up to the cursor.

Returns

CompletionSite