Table of Contents

Class SignatureSite

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

The call being written where a signature help is asked for (LSP 3.17 §Signature Help): what is called, and which of its arguments the cursor is in - read off the text of the line before the cursor, as what is being written is for a completion list (CompletionSite).

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

Remarks

The call is the innermost one whose argument list is open at the cursor: Left(x, |, o.Item(|, the Mid( of Debug.Print Left(Mid(s, 2|. An argument list that is open after no name - the parentheses of an expression, (a + | - is no call's, and the one around it is looked for. With no argument list open, the call is the statement's own when it is a call statement without parentheses (MS-VBAL §5.4.2.1): MsgBox "a", |.

Which argument the cursor is in is counted by the commas of the argument list before it, those of string literals and of argument lists inside it left out; a named argument (Prompt:=) says the name of the parameter it is given to. A : that is not the start of a := separates statements.

Constructors

SignatureSite(string, int, string?)

The call being written where a signature help is asked for (LSP 3.17 §Signature Help): what is called, and which of its arguments the cursor is in - read off the text of the line before the cursor, as what is being written is for a completion list (CompletionSite).

public SignatureSite(string Callee, int ArgumentIndex, string? ArgumentName = null)

Parameters

Callee string

What is called, as it is written: Left, o.Item, .Add, w.Grow(2).Parts.Add.

ArgumentIndex int

The position of the argument the cursor is in, from 0.

ArgumentName string

The name the argument is written with, for a named argument; null otherwise.

Remarks

The call is the innermost one whose argument list is open at the cursor: Left(x, |, o.Item(|, the Mid( of Debug.Print Left(Mid(s, 2|. An argument list that is open after no name - the parentheses of an expression, (a + | - is no call's, and the one around it is looked for. With no argument list open, the call is the statement's own when it is a call statement without parentheses (MS-VBAL §5.4.2.1): MsgBox "a", |.

Which argument the cursor is in is counted by the commas of the argument list before it, those of string literals and of argument lists inside it left out; a named argument (Prompt:=) says the name of the parameter it is given to. A : that is not the start of a := separates statements.

Properties

ArgumentIndex

The position of the argument the cursor is in, from 0.

public int ArgumentIndex { get; init; }

Property Value

int

ArgumentName

The name the argument is written with, for a named argument; null otherwise.

public string? ArgumentName { get; init; }

Property Value

string

ArgumentsBefore

The arguments of the call up to the cursor, as they are written: after the opening parenthesis of a call in parentheses, after the name and the space of a call statement. The last of them is the one the cursor is in.

public string ArgumentsBefore { get; init; }

Property Value

string

Callee

What is called, as it is written: Left, o.Item, .Add, w.Grow(2).Parts.Add.

public string Callee { get; init; }

Property Value

string

IsMemberAccess

Whether what is called is a member of something - of the expression of Qualifier, or of the object of a With block when that is empty.

public bool IsMemberAccess { get; }

Property Value

bool

IsParenthesized

Whether the arguments are in parentheses, which close them; a call statement's arguments go on to the end of the statement.

public bool IsParenthesized { get; init; }

Property Value

bool

Name

The name of what is called: Item of o.Item.

public string Name { get; }

Property Value

string

NamesBefore

The names of the named arguments written before the one the cursor is in, as they are written (Title of Title:="Hi").

public IReadOnlyList<string> NamesBefore { get; }

Property Value

IReadOnlyList<string>

PositionalBefore

How many of the arguments written before the one the cursor is in are positional, an omitted one counted (Foo 1, , | has two): each is mapped to the parameter at its position (MS-VBAL §5.3.1.11).

public int PositionalBefore { get; }

Property Value

int

Qualifier

For a IsMemberAccess, what the member is of, as it is written: o of o.Item, .Items of .Items.Add, empty for the .Add of a With block's object. Empty for a call of a name.

public string Qualifier { get; }

Property Value

string

Methods

IsFollowedByAPositionalArgument(string)

Whether a positional argument is written after the one the cursor is in, an omitted one counted (Foo 1, |, , 2): it is mapped to the parameter at its position, and no named argument comes before it (MS-VBAL §5.6.13.1).

public bool IsFollowedByAPositionalArgument(string after)

Parameters

after string

The text of the logical line from the cursor on.

Returns

bool

IsWhereAValueStarts(string)

Whether the text up to the cursor ends where a value of the argument starts: after the opening parenthesis, a comma or a :=, after the name a call statement starts with, or after an operator that combines the flags of an Enum - +, Or, And, Xor, Not (MsgBox "a", vbYesNo + |).

public bool IsWhereAValueStarts(string text)

Parameters

text string

The text of the line up to the cursor, which this site was read off.

Returns

bool

Remarks

A space anywhere else in an argument - after an operand, Foo a | - starts no value: a list of what the parameter is declared as has nothing to offer there.

IsWhereAnArgumentStarts(string)

Whether the cursor is where an argument starts, with nothing of it written but word: after the opening parenthesis, after a comma, after the name of a call statement. Not after the := of a named argument, nor inside an expression.

public bool IsWhereAnArgumentStarts(string word)

Parameters

word string

What is typed of the name at the cursor.

Returns

bool

IsWhereAnArgumentsValueStarts(string)

Whether the cursor is where the value of an argument starts, with nothing of it written but word: where an argument starts (IsWhereAnArgumentStarts(string)), or after the := of a named argument (Weigh Amounts:=|).

public bool IsWhereAnArgumentsValueStarts(string word)

Parameters

word string

What is written of the value at the cursor.

Returns

bool

NamesAfter(string)

The names of the named arguments written after the one the cursor is in, up to the end of the argument list: its closing parenthesis, or the end of the call statement (a : that separates statements, a comment, the Else of a single-line If (MS-VBAL §5.4.2.9), the end of the logical line, LogicalLine).

public IReadOnlyList<string> NamesAfter(string after)

Parameters

after string

The text of the logical line from the cursor on.

Returns

IReadOnlyList<string>

Read(string)

Reads the call being written at the end of text.

public static SignatureSite? Read(string text)

Parameters

text string

The text of the line, up to the cursor.

Returns

SignatureSite

The call; null when the cursor is in none - or in a string literal, or in a comment.