Table of Contents

Class SymbolProperties

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

Defines LSP-compliant extension properties for symbols. RDCore uses this to carry the VB_Attribute values associated with a symbol.

public static class SymbolProperties
Inheritance
SymbolProperties
Inherited Members

Fields

ArrayBounds

The bounds a fixed-size array variable was declared with (MS-VBAL §5.2.3.1.3), one for each dimension and outermost first: constant expressions, which the type of the variable has no room for and whatever allocates its storage reduces. Unset for a variable that is not a fixed-size array.

public static readonly SymbolProperty<ImmutableArray<ArrayDimensionBound>> ArrayBounds

Field Value

SymbolProperty<ImmutableArray<ArrayDimensionBound>>

AutoInstantiated

Whether a variable is an automatic instantiation variable (MS-VBAL §2.5.1): one declared with an As New clause (§5.2.3.1.1), or the default instance variable of a predeclared class (§5.2.4.1.2, declared "as if" As New). Each time its content is accessed while its value is Nothing, a new instance of its class is created and stored in it. For an array variable, it is each dependent variable — each element — that is one.

public static readonly SymbolProperty<bool> AutoInstantiated

Field Value

SymbolProperty<bool>

Creatable

The value of the VB_Creatable attribute of a VBClassModuleSymbol — whether New can instantiate it. GetProperty<T>(SymbolProperty<T>) returns C#'s default(bool) (false) when unset, the opposite of VBE's own default (creatable, for a class that declares no such attribute) — a builder that constructs a VBClassModuleSymbol MUST set this explicitly, never leave it to the read-site default. WorkspaceSymbolResolver.Compose does; other builders that synthesize a bare class module symbol without parsing its attributes (e.g. ProjectSymbolProvider) don't yet.

public static readonly SymbolProperty<bool> Creatable

Field Value

SymbolProperty<bool>

DefaultImplementation

Whether a member of an interface has an implementation of its own, which is empty: a class that implements the interface and has no procedure for the member implements it with that one, and dispatching the member to such a class does nothing.

public static readonly SymbolProperty<bool> DefaultImplementation

Field Value

SymbolProperty<bool>

Remarks

This is what lets MS-VBAL §5.3.1.9 stand as it is written - a class module that implements an interface implements every one of its members - for an interface every class implements and few handle: ClassLifecycleInterface. A member with a default is implemented by every class, so no class is in breach and no rule has an exception. Only the language sets it; there is no source syntax for an interface member that implements itself. A host's own optional events, such as those of a document or a form, are the same thing.

DefaultInterfaceOf

The class of a referenced library whose default interface a class of that library is (ReturnBoolean, on MSForms.IReturnBoolean): a type name of its own, with the class's members, which an object of the class is - and whose objects are of the class. Absent on every other class.

public static readonly SymbolProperty<string> DefaultInterfaceOf

Field Value

SymbolProperty<string>

DefaultsToOptionCompare

Whether an optional Compare parameter that a call omits takes the Option Compare of the calling module rather than its declared default (MS-VBAL §6.1.2.11: "if omitted, it uses the <option-compare-directive> of the calling module").

public static readonly SymbolProperty<bool> DefaultsToOptionCompare

Field Value

SymbolProperty<bool>

Remarks

Set by whatever contributed the symbol - the standard library's reader, off StdLibOptionCompareAttribute - because a declaration's = vbBinaryCompare says nothing of it. Absent on every parameter a workspace declares: a workspace procedure's omitted argument takes its declared default.

DesignerControl

Whether a member of a form's class is one of the form's controls: declared by the form's designer, not by its code (DeclaredControls()).

public static readonly SymbolProperty<bool> DesignerControl

Field Value

SymbolProperty<bool>

Remarks

A control is a Public, read-only property of the control's class: a Property Get, which the designer owns and the code does not assign, so Set TextBox1 = … is an invalid use of the property (MS-VBAL §5.4.3.9), and TextBox1 = "a" assigns its default member (§5.4.3.8). It is also WithEvents: the procedures named for it handle its events (TextBox1_Change).

DocString

A small documentation string about this symbol.

public static readonly SymbolProperty<string> DocString

Field Value

SymbolProperty<string>

Remarks

Provided via VB_Description attributes.

EnumValue

The value of a member of an enumeration that something other than the workspace's source declares: the library that stated it, or the standard library.

public static readonly SymbolProperty<long> EnumValue

Field Value

SymbolProperty<long>

Remarks

Such a member has no declaration to evaluate (MS-VBAL §5.2.3.4) and is allocated no storage, so the value travels with the symbol. Absent on a member a workspace declares.

Exposed

The value of the VB_Exposed attribute of a VBClassModuleSymbol

public static readonly SymbolProperty<bool> Exposed

Field Value

SymbolProperty<bool>

Extensible

The value of the VB_Extensible attribute of a VBClassModuleSymbol: whether it is an extensible module (MS-VBAL §4.2.1), which a host extends with an extension module of the same name. Such a module cannot have an Implements directive (§5.2.4.2).

public static readonly SymbolProperty<bool> Extensible

Field Value

SymbolProperty<bool>

ExternalTarget

🎯 The key identifying the external implementation a member dispatches to: a member whose code is not the workspace's, so no instruction list exists for it and IExternalDispatcher runs it instead.

public static readonly SymbolProperty<string> ExternalTarget

Field Value

SymbolProperty<string>

Remarks

Set by whatever contributed the symbol, because only that knows what the symbol stands for - the standard library's reader knows the declaration it read the member off, and nothing downstream could reconstruct it from a name. Absent on every symbol a workspace declares, which is what tells the two apart at the point of invocation.

HiddenMemberFlag

The MemberFlags bit that hides a member: it resolves like any other, and is left out of a completion list.

public const int HiddenMemberFlag = 64

Field Value

int

ImplicitlyDeclared

Whether a variable exists because something referred to its name and no declaration of it was written (MS-VBAL §5.6.10), rather than because the source declares it.

public static readonly SymbolProperty<bool> ImplicitlyDeclared

Field Value

SymbolProperty<bool>

Remarks

An implicit local says so by its DeclaredBy; an implicit module-level variable, which is what Module declares, is the same kind of symbol as an explicit one and says so here. A later declaration pass, whose resolver already holds this variable, needs to tell it from a variable the source declares, or it would take its own earlier output for the declaration it is about to make.

Library

The name of the library project a symbol belongs to — VBA for the standard library of a VBA environment — or unset for a symbol of the enclosing project.

public static readonly SymbolProperty<string> Library

Field Value

SymbolProperty<string>

Remarks

The standard library's modules sit at the same tier of the scope tree as the workspace's own, which is what lets Len resolve unqualified. Which project a module is in is the one thing that tier cannot say, and the thing a project-qualified reference (VBA.Strings.LenB, VBA.LenB; MS-VBAL §5.6.12) needs to know. A library project's own VBProjectSymbol carries the same name, and a qualifier reaches the modules and members that carry it. The name is the environment's: a VB6 environment will call it something else.

LibraryPriority

The precedence of the library a symbol is of among the libraries of a project: of two libraries that declare a name, the one with the higher number is the one the name means. The standard library, which has none, is the lowest; a library a project references comes after it, in the order of the project's references; and one that is only loaded because another depends on it comes before the ones the project references.

public static readonly SymbolProperty<int> LibraryPriority

Field Value

SymbolProperty<int>

MemberFlags

A metadata flag that is used for controlling the member behavior.

public static readonly SymbolProperty<int> MemberFlags

Field Value

SymbolProperty<int>

Remarks

Provided via VB_MemberFlags attributes, with a handful of useful "magic" values.

Name

The programmatic name of a VBModuleSymbol, as determined by the VB_Name attribute.

public static readonly SymbolProperty<string> Name

Field Value

SymbolProperty<string>

PassedByAddress

Whether a library parameter declared with a type of its own is given the address of what it is passed - a variable of its type, or a Variant holding a value of it - rather than the value (StdLibByAddressAttribute): StrPtr's, which is the address of the very String.

public static readonly SymbolProperty<bool> PassedByAddress

Field Value

SymbolProperty<bool>

Remarks

Set by the standard library's reader. The parameter is ByVal to the language: it takes what any argument of its type is.

PredeclaredId

The value of the VB_PredeclaredId attribute of a VBClassModuleSymbol.

public static readonly SymbolProperty<bool> PredeclaredId

Field Value

SymbolProperty<bool>

ProgId

The name an object of a class of a referenced library is created by from a string - CreateObject("Scripting.Dictionary") - on a class that can be created.

public static readonly SymbolProperty<string> ProgId

Field Value

SymbolProperty<string>

ReportedTypeName

What TypeName says of an object of a class of the standard library, when it is not the class's name (Object, for the UserForms collection's). Absent on every other class.

public static readonly SymbolProperty<string> ReportedTypeName

Field Value

SymbolProperty<string>

TypeLibraryByRef

Whether the VBA type library declares a library parameter by reference - a VARIANT* for every Variant parameter, and a few others (StdLibTypeLibraryByRefAttribute) - where the platform passes it by value: a call-site ByVal written for it is a compile error, as it is for any parameter that is ByRef (MS-VBA, recorded in Excel; RD-VBAL §5.6.13.1).

public static readonly SymbolProperty<bool> TypeLibraryByRef

Field Value

SymbolProperty<bool>

Remarks

Set by the standard library's reader. It says nothing of how the argument is passed, which is the parameter's VBParameterSymbol.ParameterKind.

UserMemId

A metadata flag that is used for controlling the member behavior.

public static readonly SymbolProperty<int> UserMemId

Field Value

SymbolProperty<int>

Remarks

Provided via VB_UserMemId attributes; unique for each member of a given module, with value 0 denoting the default member.

ValueDestination

What a parameter declared Variant expects of an object given to it, when it reads the value of its argument as MS-VBA compiles it: CInt's does, Round's does not (ObjectValueStaticSemantics).

public static readonly SymbolProperty<ValueDestination> ValueDestination

Field Value

SymbolProperty<ValueDestination>

Remarks

Set by the standard library's reader, off StdLibValueAttribute. Absent on every other parameter: one declared with a value type expects a value of that type, which its declared type says, and a Variant one a workspace declares takes an object as it is.

WithEvents

Whether a variable is declared with the WithEvents modifier (MS-VBAL §5.2.3.1.2): its declared type is a class with events, and the procedures of the module that are named for the variable and an event of the class handle that event of whatever object the variable currently holds.

public static readonly SymbolProperty<bool> WithEvents

Field Value

SymbolProperty<bool>