Table of Contents

Class DefineSymbolsParams

Namespace
RDCore.SDK.Platform.Protocol
Assembly
RDCore.SDK.dll

Request for rdcore/host/symbols/define: the language server sends the environment host the member symbols one workspace module declares, as descriptors. The host reconstructs a runtime Symbol from each, resolves its declared type name against its own session, and defines it in the session symbol table.

[Method("rdcore/host/symbols/define", Direction.ClientToServer)]
public record DefineSymbolsParams : IRequest, IRequest<Unit>, IRequest<DefineSymbolsResult>, IBaseRequest, IEquatable<DefineSymbolsParams>
Inheritance
DefineSymbolsParams
Implements
IRequest
IRequest<Unit>
IBaseRequest
Inherited Members

Remarks

Module symbols are not carried here — the host already has them from the .rdproj. The descriptors are the transport form of what the language server's SyntaxTreeSymbolProvider produces. A name declared in several conditional-compilation branches arrives as one descriptor carrying every branch in Definitions; the host defines the single symbol and leaves live/dead branch selection to a later pass.

Properties

CodeOnly

Whether the module's symbols were defined by an earlier request, and this one is for its code alone: the host defines nothing, composes the class, and loads the module's procedures from ParseResultJson.

public bool CodeOnly { get; init; }

Property Value

bool

Remarks

A module's code is checked against what the whole workspace declares (RD-VBAL §5.0.1), and the host is told of the modules one at a time: a module that names one that comes after it cannot be checked until that one is defined. The language server defines every module first, and then sends the code of each.

Directives

The module's own Option directives (MS-VBAL §5.2.1), which the host applies to its module symbol.

public ModuleDirectives Directives { get; init; }

Property Value

ModuleDirectives

Remarks

These are run-time dials, not only static ones: Option Compare decides how the relational operators compare String values in the module's code, and Option Base decides what an array dimension declared without a lower bound means. Both are read off the activation's own call-stack frame, which gets them from the module symbol the procedure is declared in.

ImplementedInterfaceNames

The names of the interfaces the module's Implements directives name (MS-VBAL §5.2.4.2), as written and in source order; empty for a module that has none, and for one that is not a class module.

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

Property Value

ImmutableArray<string>

Remarks

The host composes the class from them once its members are defined (TryComposeClassModule(string, ImmutableArray<string>, ImmutableArray<SourceRange>)), resolving each to the class it names among the class modules it has: an object of the class is then an object that implements the interface, which is what a call through a variable declared as the interface is dispatched on (§5.3.1.9), and what a TypeOf ... Is and a Set to such a variable are decided by.

ImplementedInterfaceRanges

Where each of ImplementedInterfaceNames is written in the module: the range of its Implements directive, one for each name and in the same order, or empty when they are not known.

public ImmutableArray<SourceRange> ImplementedInterfaceRanges { get; init; }

Property Value

ImmutableArray<SourceRange>

ModuleName

The module's name. The member symbols attach under the module symbol of this name in the session.

public string ModuleName { get; init; }

Property Value

string

ModuleUri

The Uri of the module these symbols belong to. Informational — the host re-derives the parent module symbol from WorkspaceRoot and ModuleName.

public Uri? ModuleUri { get; init; }

Property Value

Uri

ParseResultJson

The System.Text.Json representation of the module's ModuleParseResult (see PlatformJson), or empty when the module is defined for its symbols alone.

public string ParseResultJson { get; init; }

Property Value

string

Remarks

What gives the module's procedures code. A module the host is asked to run carries its parse result with that request and is loaded then; a module of the workspace is never run as such, but its procedures are called by the ones that are, and its class members by the objects that are made of it. The AST is polymorphic, which is why it rides a string and not the transport's own serializer.

Replace

Whether a descriptor replaces an already-defined symbol of the same identity rather than being skipped.

public bool Replace { get; init; }

Property Value

bool

Remarks

The one-shot workspace sync defines each module once, and first-definition-wins is what collapses a name declared in several conditional-compilation branches. A module the user is editing is the other case: it is defined again every time it is run, and the newest definition is the one that is true — skipping it would leave the session running yesterday's symbols, with whatever locals and declared types they had.

Symbols

The member symbol descriptors, in declaration order.

public ImmutableArray<SymbolDescriptor> Symbols { get; init; }

Property Value

ImmutableArray<SymbolDescriptor>

WorkspaceRoot

The workspace root the module and its symbols are addressed under. Matches the root the host composed its session with, so reconstructed symbol Uris line up with the module symbol.

public Uri? WorkspaceRoot { get; init; }

Property Value

Uri