Table of Contents

Class CompletionCandidates

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

The names a completion list offers, as the scope tree of a composed workspace has them: the names visible from where the list is asked for, the members of a module, a project or a type, and the keywords of the language.

public static class CompletionCandidates
Inheritance
CompletionCandidates
Inherited Members

Remarks

The names are the ones the resolver would bind (ScopeTreeSymbolResolver): a name declared nearer shadows one of the same name declared farther, and is the only one offered. What a scope declares that is not a name in the binding context the list is for is not offered - a user-defined type is no value, a local is no type (MS-VBAL §5.6.4). A member declared Private is offered only where it is accessible, which is in its own module (MS-VBAL §5.2.3), and a member a library hides (VB_MemberFlags, HiddenMemberFlag) is not offered at all, as the VBE's own lists leave it out.

A name is offered once whatever the number of its declarations: the Get, the Let and the Set of a property are one property.

Methods

Classes(ScopeTree, Uri)

The classes that can be named where origin is, as the interface of an Implements (MS-VBAL §5.2.4.2) or the type of a TypeOf ... Is (§5.6.9.8.1): the class modules of the project, and the classes of the libraries.

public static IReadOnlyList<CompletionCandidate> Classes(ScopeTree tree, Uri origin)

Parameters

tree ScopeTree

The scope tree of the composed workspace.

origin Uri

Where the lookup originates (OriginAt(ScopeTree, Uri, SourcePosition)).

Returns

IReadOnlyList<CompletionCandidate>

EventsOf(ScopeTree, Uri)

The events the class module that origin is in declares: what a RaiseEvent raises (MS-VBAL §5.4.2.20).

public static IReadOnlyList<CompletionCandidate> EventsOf(ScopeTree tree, Uri origin)

Parameters

tree ScopeTree

The scope tree of the composed workspace.

origin Uri

Where the lookup originates (OriginAt(ScopeTree, Uri, SourcePosition)).

Returns

IReadOnlyList<CompletionCandidate>

Matching(IReadOnlyList<CompletionCandidate>, string)

The candidates whose label has the letters of prefix, in their order, in any case: what a client can still show for the name being typed, however it narrows its list - by the start of the label, by a part of it, or by letters that are not next to each other (gtc for GetCount). A list narrowed this way is complete for every word the prefix is the start of.

public static IReadOnlyList<CompletionCandidate> Matching(IReadOnlyList<CompletionCandidate> candidates, string prefix)

Parameters

candidates IReadOnlyList<CompletionCandidate>

The candidates, in the order they rank.

prefix string

What is typed of the name; an empty prefix is every candidate.

Returns

IReadOnlyList<CompletionCandidate>

The candidates that match, in the order they were given.

Remarks

A list is the length of what is in scope - the members of the standard library, of the libraries the project references, of every module of the workspace - and travels to the client each time a name starts: the letters typed by then are what it is narrowed to before it does.

MembersOf(ScopeTree, Symbol, Uri)

The members of a namespace - a project or a procedural module - as the right-hand side of a member access on it (MS-VBAL §5.6.12): the modules of a project and the members of its procedural modules, or the members of a module, its Private ones only where they are accessible.

public static IReadOnlyList<CompletionCandidate> MembersOf(ScopeTree tree, Symbol owner, Uri origin)

Parameters

tree ScopeTree

The scope tree of the composed workspace.

owner Symbol

The project or the module.

origin Uri

Where the lookup originates (OriginAt(ScopeTree, Uri, SourcePosition)), which decides what is accessible.

Returns

IReadOnlyList<CompletionCandidate>

MembersOf(VBType)

The members of a value of the type type, as the right-hand side of a member access on it (MS-VBAL §5.6.12): the members of the default interface of a class, the fields of a user-defined type, the constants of an Enum. None for a type that has no members known when the code is written - a Variant, an Object - whose members are bound when it runs.

public static IReadOnlyList<CompletionCandidate> MembersOf(VBType type)

Parameters

type VBType

The declared type of the expression the member is accessed on.

Returns

IReadOnlyList<CompletionCandidate>

Names(ScopeTree, Uri)

The names that can be written as a simple name expression where origin is: what the procedure, the module, the project, the libraries and the language declare, nearest first. The keywords are not names; which of them can be written where is CompletionRules' to say.

public static IReadOnlyList<CompletionCandidate> Names(ScopeTree tree, Uri origin)

Parameters

tree ScopeTree

The scope tree of the composed workspace.

origin Uri

Where the lookup originates (OriginAt(ScopeTree, Uri, SourcePosition)).

Returns

IReadOnlyList<CompletionCandidate>

NamespaceOf(ISymbolResolver, Uri, string, bool)

The project or the module a qualifier names, when it names one: VBA, VBA.Strings, Module1 - what a member access is written on that is a namespace and not a value, and whose members are its declarations (MembersOf(ScopeTree, Symbol, Uri)).

public static Symbol? NamespaceOf(ISymbolResolver resolver, Uri origin, string qualifier, bool typeContext)

Parameters

resolver ISymbolResolver

The resolver of the composed workspace.

origin Uri

Where the lookup originates (OriginAt(ScopeTree, Uri, SourcePosition)).

qualifier string

The qualifier, as it is written: names separated by ..

typeContext bool

Whether the qualifier is the one of a qualified type name, which is bound in the type binding context (ResolveQualifier(string, ScopeKind, Uri)); otherwise it is bound as a simple name expression is.

Returns

Symbol

The project or the module; null when the qualifier names anything else, or nothing.

OriginAt(ScopeTree, Uri, SourcePosition)

Where a name written at position of a module is looked up from: the procedure the position is in, or the module itself when it is in none - in the declarations section, say.

public static Uri OriginAt(ScopeTree tree, Uri moduleUri, SourcePosition position)

Parameters

tree ScopeTree

The scope tree of the composed workspace.

moduleUri Uri

The module's own URI.

position SourcePosition

The position, in the module's source.

Returns

Uri

The URI of the symbol the lookup originates from.

Types(ScopeTree, Uri, bool)

The names that can be written as a declared type where origin is (Type), or as the class of a New (NewType). After As: the intrinsic types; the classes, user-defined types and Enums the project and the libraries declare; the projects and the libraries, which qualify a type name; and New. After New: the classes that can be created, and the projects and the libraries. Nothing that is no type is offered - not a procedural module, not a local, not a keyword but New.

public static IReadOnlyList<CompletionCandidate> Types(ScopeTree tree, Uri origin, bool creatable)

Parameters

tree ScopeTree

The scope tree of the composed workspace.

origin Uri

Where the lookup originates (OriginAt(ScopeTree, Uri, SourcePosition)).

creatable bool

Whether only the classes that New can create are offered.

Returns

IReadOnlyList<CompletionCandidate>

TypesOf(ScopeTree, Symbol, bool)

The types a project or a module declares, as the last part of a qualified type name (VBA.Collection, Module1.Point; MS-VBAL §5.6.12).

public static IReadOnlyList<CompletionCandidate> TypesOf(ScopeTree tree, Symbol owner, bool creatable)

Parameters

tree ScopeTree

The scope tree of the composed workspace.

owner Symbol

The qualifier, as ResolveQualifier(string, ScopeKind, Uri) bound it.

creatable bool

Whether only the classes that New can create are offered.

Returns

IReadOnlyList<CompletionCandidate>