Table of Contents

Class CompletionPlacement

Namespace
RDCore.SDK.Model.Symbols.Completion
Assembly
RDCore.SDK.dll

Where a line is in its module: in the declarations section or in a procedure, in which blocks, and what the labels of the procedure are - what decides the statements and the keywords that can be written on it (MS-VBAL §5.2, §5.4).

public sealed record CompletionPlacement : IEquatable<CompletionPlacement>
Inheritance
CompletionPlacement
Implements
Inherited Members

Remarks

It is read off the text, statement by statement, and not off the parse of the module. Code that is being typed seldom parses, and least of all where it matters: a For whose Next is the line being written is a For that is not closed. The lines before the line are what say which blocks are open, and the blocks that are open on it are the ones that were opened and not closed before it.

A statement is what a line has between its :s, with its continuation lines, its comment left out, and its line number or label taken off: a label is the procedure's, and so is a line number (MS-VBAL §5.4.1.1).

Constructors

CompletionPlacement(CompletionProcedure?, ImmutableArray<CompletionBlock>, ImmutableArray<string>, ImmutableArray<string>)

Where a line is in its module: in the declarations section or in a procedure, in which blocks, and what the labels of the procedure are - what decides the statements and the keywords that can be written on it (MS-VBAL §5.2, §5.4).

public CompletionPlacement(CompletionProcedure? Procedure, ImmutableArray<CompletionBlock> Blocks, ImmutableArray<string> Options, ImmutableArray<string> Labels)

Parameters

Procedure CompletionProcedure?

The procedure the line is in; null in the declarations section, or between procedures.

Blocks ImmutableArray<CompletionBlock>

The blocks the line is inside of, innermost first.

Options ImmutableArray<string>

The options the module states on its other lines - Explicit, Base, Compare, Private - each of which a module states once at most (MS-VBAL §5.2.1).

Labels ImmutableArray<string>

The labels and the line numbers of the procedure the line is in, in the order they are written.

Remarks

It is read off the text, statement by statement, and not off the parse of the module. Code that is being typed seldom parses, and least of all where it matters: a For whose Next is the line being written is a For that is not closed. The lines before the line are what say which blocks are open, and the blocks that are open on it are the ones that were opened and not closed before it.

A statement is what a line has between its :s, with its continuation lines, its comment left out, and its line number or label taken off: a label is the procedure's, and so is a line number (MS-VBAL §5.4.1.1).

Properties

AllOptions

The options a module can state, as the word after Option.

public static IReadOnlyList<string> AllOptions { get; }

Property Value

IReadOnlyList<string>

Blocks

The blocks the line is inside of, innermost first.

public ImmutableArray<CompletionBlock> Blocks { get; init; }

Property Value

ImmutableArray<CompletionBlock>

IsInProcedure

Whether the line is in a procedure, where statements are written; outside of one, only declarations are.

public bool IsInProcedure { get; }

Property Value

bool

Labels

The labels and the line numbers of the procedure the line is in, in the order they are written.

public ImmutableArray<string> Labels { get; init; }

Property Value

ImmutableArray<string>

Options

The options the module states on its other lines - Explicit, Base, Compare, Private - each of which a module states once at most (MS-VBAL §5.2.1).

public ImmutableArray<string> Options { get; init; }

Property Value

ImmutableArray<string>

Procedure

The procedure the line is in; null in the declarations section, or between procedures.

public CompletionProcedure? Procedure { get; init; }

Property Value

CompletionProcedure?

Methods

IsIn(CompletionBlock)

Whether the line is inside of a block of kind, however deep.

public bool IsIn(CompletionBlock kind)

Parameters

kind CompletionBlock

The kind of block.

Returns

bool

LineLabelled(IReadOnlyList<string>, string)

The line of a module that is labelled - or numbered - label (MS-VBAL §5.4.1.1), or -1 for a label the module does not have.

public static int LineLabelled(IReadOnlyList<string> lines, string label)

Parameters

lines IReadOnlyList<string>

The lines of the module's source.

label string

The label, or the line number.

Returns

int

NumberedLinesOf(IReadOnlyList<string>)

The lines of a module that are numbered (MS-VBAL §5.4.1.1), and the statements they are: what a line number of the module names - the lines of a program of the platform's BASIC, chiefly.

public static IReadOnlyList<(string Number, string Statement)> NumberedLinesOf(IReadOnlyList<string> lines)

Parameters

lines IReadOnlyList<string>

The lines of the module's source.

Returns

IReadOnlyList<(string Number, string Statement)>

Read(IReadOnlyList<string>, int)

Where line line of a module is.

public static CompletionPlacement Read(IReadOnlyList<string> lines, int line)

Parameters

lines IReadOnlyList<string>

The lines of the module's source.

line int

The zero-based line.

Returns

CompletionPlacement