2.2.3 ProjectFile
Note
This specification may be incomplete at this time.
RD-VBA discovers a file system folder as a workspace folder when the folder contains a text file named .rdproj that can be successfully deserialized into a ProjectFile. That folder is then the root of that workspace folder.
{
"Version": "",
"Configuration": [],
"ProjectInfo": RDCoreProject
}
| Member | Type | Description |
|---|---|---|
Version |
string |
The RD-VBA language core version the project file was serialized with. |
Configuration |
array of string |
The locations (relative paths) of any configuration files to bind at run-time. |
ProjectInfo |
RDCoreProject |
An object that describes the content of an RD-VBA project. |
Tip
This model is intended to natively support VB6 project files (.vbp).
2.2.3.1 RDCoreProject
RDCoreProject is a serializable model representing an RD-VBA project.
{
"Name": "",
"References": [RDCoreReference],
"Modules": [RDCoreModule],
"OtherFiles": [RDCoreFile],
"Folders": []
}
| Member | Type | Description |
|---|---|---|
Name |
string |
The name the project file was serialized with. |
References |
array of RDCoreReference |
The project references. |
Modules |
array of RDCoreModule |
The project source files. |
OtherFiles |
array of RDCoreFile |
Any non-source files included in the project. |
Folders |
array of string |
The names of all the folders in the project, whether they contain source code files or not. |
Important
The Name of a project must be a valid identifier name. It should not be VBA, or any other reserved identifier name.
The rule is worded "should not" because whether a source project can reference a different project that has the same name is explicitly specified as host-dependent behavior. An RD-VBA host environment should explicitly deny the addition of any such ambiguous project reference.
The standard library symbols are present in a project whether or not its .rdproj mentions the library at all (see RD-VBAL §6.0 Standard Library).
2.2.3.2 RDCoreReference
RDCoreReference describes a reference within a project.
{
"Name": "",
"Guid": "",
"AbsolutePath": "",
"Major": 0,
"Minor": 0,
"IsUnremovable": false
}
| Member | Type (default) | Description |
|---|---|---|
Name |
string |
The identifier name (token) used in workspace source code to reference this library. |
Guid |
string |
A Globally Unique Identifier optionally identifying the referenced library in a host-defined application registry. |
AbsolutePath |
string |
The full path to the physical location of the referenced library, if it exists. |
Major |
number (0) |
The major version number of the referenced library, if available. |
Minor |
number (0) |
The minor version number of the referenced library, if available. |
IsUnremovable |
boolean (false) |
A soft indicator marking the reference as unremovable from an LSP client. |
Note
🧩 A supplied Guid necessarily refers to a COM registered library. Resolving such a library implies platform-specific Windows Registry lookups.
The environment host may use implementation-dependent alternative means to provide symbols and semantics for such references.
👉 An RDCoreReference for a reference to a VBHostProjectType project must have the "unremovable" flag (IsUnremovable) set (see RD-VBAL §2.4.2 Non-intrinsic Types).
The order in which project references appear in the .rdproj file of a workspace folder determines the reference priority (see RD-VBAL §2.3.1.3 Name Resolution).
IRuntimeSession.References is the runtime-facing view of the .rdproj RDCoreReference list (see RD-VBAL §2.3.1.2 Session Services).
2.2.3.3 RDCoreModule
RDCoreModule describes the modules (source files) of a workspace folder.
{
"Name": "",
"Super": null
}
| Member | Description |
|---|---|
Name |
The identifier name (token) used in workspace source code to reference this module. |
DocClassType |
A string value that can be parsed as a member of the DocClassType enumeration. |
Important
The value of the Name property of an RDCoreModule must be unique across the entire workspace.
The Name of an RDCoreModule is always supplied by a VB_Name attribute (see RD-VBAL §3.1.1 Attributes). In case of a mismatch between Name and the value of the VB_Name attribute, the attribute value always takes precedence.
2.2.3.3.1 DocClassType Enum
Note
🧩 This enum type is an extension point: it is intended to be extended as additional document modules are explicitly supported.
The DocClassType enumeration defines constants that internally map extensible (document) modules to certain specific class types:
| Name | Value |
|---|---|
Unknown |
0 |
ExcelWorkbook |
1 |
ExcelWorksheet |
2 |
AccessForm |
3 |
AccessReport |
4 |
Document modules can only be added to a VBA project via the host application that defines them. Exporting a document module from an MS-VBA project via the VBIDE Extensibility API produces a .cls file, which would then re-import as a class module.
Rubberduck (the VBE add-in) exported document modules with a .doccls extension, to distinguish the two class types. Document modules are distinguished from class modules because a document module's base class metadata is externally defined.
RD-VBA can load the necessary symbols for document module interfaces, but their implementation belongs to their respective host application.
Note
RD-VBA cannot create a Workbook host document, nor a Worksheet module in its Sheets collection, because that is the responsibility of Microsoft Excel.
Instead, RD-VBA identifies the interfaces a document module requires using the DocClassType enum. This allows static semantics to correctly identify all the members and available events of a document module.
Workspace source code that is directly dependent on a host document necessarily requires an appropriate host to evaluate correctly. In such cases, the RD-VBA runtime implementation may start an automation host process as needed, if such a host exists in the runtime environment.
🎯 A more portable approach is to refactor MS-VBA legacy code so that any host-dependent calls are decoupled from the logic. RDCore semantic analysis capabilities should support all the diagnostics and refactoring tools needed to do this.
2.2.3.4 RDCoreFile
RDCoreFile describes additional (non-source) files contained in a workspace folder, but not necessarily given to a language server for processing.
Tip
For example, an RDCoreProject could include README.md, CONTRIBUTING.md, and LICENCE.md text/markdown files as RDCoreFile entries. These files would always be bundled with the project, but ignored by the RD-VBA language core.
{
"Name": ""
}
| Member | Description |
|---|---|
Name |
The identifier name (token) used in workspace source code to reference this module. |
⏮️ RD-VBAL §2.2.2 WorkspaceFile | ⏭️ RD-VBAL §2.3 Application Host