Class VBProjectSymbol
A VBA project, as a resolvable, named symbol: the enclosing project, or a library it references. It is a namespace of the
type binding context (MS-VBAL §5.6.4): a qualified type reference like Project.ClassName resolves
Project to a project symbol before looking up ClassName among that project's modules.
public sealed record VBProjectSymbol : Symbol, IEquatable<Symbol>, IEquatable<VBProjectSymbol>
- Inheritance
-
VBProjectSymbol
- Implements
- Inherited Members
Remarks
The enclosing project's symbol has no Library. A referenced library is a project symbol of its own, named for
the library, with Library set to that name, as are the symbols it declares (LibrarySymbolReader, and
the standard library's symbol provider). The property is what tells a library's types from those of the enclosing project, and from
those of another library (ResolveProjectType(VBProjectSymbol, string)).
Constructors
VBProjectSymbol(Uri, string)
A VBA project, as a resolvable, named symbol: the enclosing project, or a library it references. It is a namespace of the
type binding context (MS-VBAL §5.6.4): a qualified type reference like Project.ClassName resolves
Project to a project symbol before looking up ClassName among that project's modules.
public VBProjectSymbol(Uri WorkspaceRoot, string Name)
Parameters
WorkspaceRootUriA
Urirepresenting the absolute path to the workspace.NamestringThe project's own name (its
.rdproj/VBA project name).
Remarks
The enclosing project's symbol has no Library. A referenced library is a project symbol of its own, named for
the library, with Library set to that name, as are the symbols it declares (LibrarySymbolReader, and
the standard library's symbol provider). The property is what tells a library's types from those of the enclosing project, and from
those of another library (ResolveProjectType(VBProjectSymbol, string)).
Methods
InterfaceMembersOf(ISymbolResolver, VBClassModuleSymbol)
The members of the interface of a class, as its declaration is now: its default interface, and, for a document module, the members of its host's class that it does not declare itself (ResolveHostClass(ISymbolResolver, VBClassModuleSymbol)) - an event is no member a name reaches.
public static IReadOnlyList<VBTypeMemberSymbol> InterfaceMembersOf(ISymbolResolver resolver, VBClassModuleSymbol declared)
Parameters
resolverISymbolResolverThe resolver names are bound by.
declaredVBClassModuleSymbolThe class module a type holds.
Returns
ResolveClass(ISymbolResolver, VBClassModuleSymbol)
Gets the class module a type was built from, as the composition has it now.
public static VBClassModuleSymbol? ResolveClass(ISymbolResolver resolver, VBClassModuleSymbol declared)
Parameters
resolverISymbolResolverThe resolver names are bound by.
declaredVBClassModuleSymbolThe class module a type holds.
Returns
- VBClassModuleSymbol
The class as it is now, or null when the composition no longer has it.
Remarks
A declared type carries the class as it was when the type was built, and the class is what its members are read from. It is found by the name it was declared with and the library that declared it: the order of the references decides what a bare name means, and this is not a bare name. A class of the workspace has no library, and is found by its name as it always was.
ResolveHostClass(ISymbolResolver, VBClassModuleSymbol)
Gets the class of a referenced library whose object a document module's document is (HostClass), by the name of its library and its own.
public static VBClassModuleSymbol? ResolveHostClass(ISymbolResolver resolver, VBClassModuleSymbol module)
Parameters
resolverISymbolResolverThe resolver names are bound by.
moduleVBClassModuleSymbolThe class module.
Returns
- VBClassModuleSymbol
The host's class, or null for a module that is no document module, and when the project does not reference its library.
ResolveQualifiedType(ISymbolResolver, string?, string, Uri)
Resolves the type name in the type binding context (MS-VBAL §5.6.4),
honoring an optional qualifier (a project name, e.g. the Project in
Project.ClassName).
public static SymbolResolutionResult ResolveQualifiedType(ISymbolResolver resolver, string? qualifier, string name, Uri handle)
Parameters
resolverISymbolResolverThe resolver names are bound by.
qualifierstringThe qualifier, a project's or a module's name; null for a bare name.
namestringThe name of the type.
handleUriThe address of the symbol whose scope a bare name, and the qualifier, are bound from.
Returns
- SymbolResolutionResult
The type, or Unbound.
Remarks
The lookup is positional. A bare name, and the last part of a qualified one, is bound by
ResolveType(string, ScopeKind, Uri); the qualifier is a namespace, bound by
ResolveQualifier(string, ScopeKind, Uri), where neither a user-defined type nor an Enum type is a
candidate, since neither can contain a type. A Type of the enclosing module that shares the project's
name therefore does not stand in for the project in Project.ClassName, though it is still what the bare
name Project means. When the qualifier is a project, the enclosing one or a referenced library,
name is looked up among that project's types (ResolveProjectType(VBProjectSymbol, string)), not from
handle, so nothing declared in the enclosing module can hide the project's module or type it names. When the qualifier
is a module, name is a Type or an Enum of that module (MS-VBAL §5.6.12). A qualifier that
resolves to neither a project nor a module stays unbound.