Table of Contents

Class ModuleName

Namespace
RDCore.SDK.Workspace
Assembly
RDCore.SDK.dll

Resolves a VBA module's programmatic name.

public static class ModuleName
Inheritance
ModuleName
Inherited Members

Remarks

A module is named by its module-level Attribute VB_Name = "…" directive. The source file name is only a fallback, for source that declares no such attribute (a hand-authored fragment, a module that was never round-tripped through the VBE). Exported VBA always emits the attribute as the first physical line of the file.

The language server, which parses every module, resolves the declared name from the AST (ModuleNodeExtensions.GetDeclaredName); components without a parser (the environment host, the project-file dedup check) scan the raw source through FromSource(string?). Both paths then apply the same FromFileName(string) fallback, so the module symbol the host composes and the member symbols the language server defines against it line up on one name.

Methods

FromFileName(string)

The file name of relativeUri, without its directory part or extension.

public static string FromFileName(string relativeUri)

Parameters

relativeUri string

Returns

string

Remarks

Platform-agnostic: both / and </code> separate segments regardless of the host OS, so a .rdproj authored on Windows resolves the same way on the Linux CI.

FromSource(string?)

The value of source's module-level Attribute VB_Name directive, or null when the source declares none.

public static string? FromSource(string? source)

Parameters

source string

Returns

string

Remarks

A member-qualified attribute (Attribute Foo.VB_Name) is not a module name and is ignored. The value is a string literal, so surrounding quotes are stripped and a doubled "" escape is unescaped.

Resolve(string?, string)

The module name declared by source's module-level Attribute VB_Name, or the relativeUri file name (without its extension) when the source declares none.

public static string Resolve(string? source, string relativeUri)

Parameters

source string

The raw module source, or null when it could not be read.

relativeUri string

The module's workspace-relative path, used for the fallback.

Returns

string