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
ProcedureCompletionProcedure?The procedure the line is in; null in the declarations section, or between procedures.
BlocksImmutableArray<CompletionBlock>The blocks the line is inside of, innermost first.
OptionsImmutableArray<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).LabelsImmutableArray<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
Blocks
The blocks the line is inside of, innermost first.
public ImmutableArray<CompletionBlock> Blocks { get; init; }
Property Value
IsInProcedure
Whether the line is in a procedure, where statements are written; outside of one, only declarations are.
public bool IsInProcedure { get; }
Property Value
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
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
Procedure
The procedure the line is in; null in the declarations section, or between procedures.
public CompletionProcedure? Procedure { get; init; }
Property Value
Methods
IsIn(CompletionBlock)
Whether the line is inside of a block of kind, however deep.
public bool IsIn(CompletionBlock kind)
Parameters
kindCompletionBlockThe kind of block.
Returns
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
linesIReadOnlyList<string>The lines of the module's source.
labelstringThe label, or the line number.
Returns
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
linesIReadOnlyList<string>The lines of the module's source.
Returns
Read(IReadOnlyList<string>, int)
Where line line of a module is.
public static CompletionPlacement Read(IReadOnlyList<string> lines, int line)
Parameters
linesIReadOnlyList<string>The lines of the module's source.
lineintThe zero-based line.