Class SymbolProperties
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
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
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
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
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.
DocString
A small documentation string about this symbol.
public static readonly SymbolProperty<string> DocString
Field Value
Remarks
Provided via VB_Description attributes.
Exposed
The value of the VB_Exposed attribute of a VBClassModuleSymbol
public static readonly SymbolProperty<bool> Exposed
Field Value
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
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
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
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
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
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.
MemberFlags
A metadata flag that is used for controlling the member behavior.
public static readonly SymbolProperty<int> MemberFlags
Field Value
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
PredeclaredId
The value of the VB_PredeclaredId attribute of a VBClassModuleSymbol.
public static readonly SymbolProperty<bool> PredeclaredId
Field Value
UserMemId
A metadata flag that is used for controlling the member behavior.
public static readonly SymbolProperty<int> UserMemId
Field Value
Remarks
Provided via VB_UserMemId attributes; unique for each member of a given module, with value 0 denoting the default member.
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