Class ImplementedInterfaceResolution
Resolves the interface names of the Implements directives of class modules
(ImplementedInterfaceNames, MS-VBAL §5.2.4.2) to the classes they name.
public static class ImplementedInterfaceResolution
- Inheritance
-
ImplementedInterfaceResolution
- Inherited Members
Remarks
A class module's ImplementedInterfaces hold the interface class symbols as they are when it is resolved, so whatever composes class modules - the language server over a workspace, the environment host over the modules it is sent one at a time - resolves them over the whole set, and again when any of them changes: an interface defined after the class that implements it, or edited since, is otherwise a stale snapshot of itself.
Resolution is recursive and memoized by Uri, not a flat single pass: a flat pass would assign each class's
interfaces from the pre-resolution snapshot, so a transitive chain (Widget Implements IMiddle,
IMiddle Implements IBase) would leave IMiddle's own interfaces looking empty from Widget's side,
whichever order the two classes come in. Recursing into (and caching) each interface's own fully resolved symbol is
what makes FromClassModule(VBClassModuleSymbol)'s own recursion see the whole
chain from any entry point.
A name that is no class among the ones given, one that is the class itself, and one a directive repeats are dropped rather than reported: they are what ImplementsSemantics reports, from the names.
Methods
Resolve(IEnumerable<VBClassModuleSymbol>)
Resolves the implemented interfaces of every class module in classModules that names any.
public static IReadOnlyDictionary<string, VBClassModuleSymbol> Resolve(IEnumerable<VBClassModuleSymbol> classModules)
Parameters
classModulesIEnumerable<VBClassModuleSymbol>Every class module the names can refer to.
Returns
- IReadOnlyDictionary<string, VBClassModuleSymbol>
The class modules that name an interface, resolved, keyed by their Symbol.Uri as an absolute URI string - a
Uri's own equality ignores the fragment, which is where a symbol's identity lives.