Table of Contents

Class ProjectModuleKinds

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

Decides what a module of a project is, and reads its text, the way every side of the platform does: a client that shows a project's modules, such as an IDE's add-in, gets the answer the environment host and the language server get.

public static class ProjectModuleKinds
Inheritance
ProjectModuleKinds
Inherited Members

Remarks

A module whose entry in the project names a document (Super) is a document module, whatever its text and its file name. Any other module is a class module when its text has a VERSION header, and a standard module otherwise: RD-VBA decides a module's kind from its source, not from its file's extension.

Methods

Of(RDCoreModule, string?)

The kind of module, from its entry in the project and its text.

public static ProjectModuleKind Of(RDCoreModule module, string? source)

Parameters

module RDCoreModule

The module's entry in the project.

source string

The module's text (ReadText(byte[])), or null when it could not be read.

Returns

ProjectModuleKind

Of(DocClassType?, string?)

The kind of a module that the project says is the code of super, or of no document when it is null.

public static ProjectModuleKind Of(DocClassType? super, string? source)

Parameters

super DocClassType?

What the project says the module's document is (Super).

source string

The module's text (ReadText(byte[])), or null when it could not be read.

Returns

ProjectModuleKind

ReadText(byte[])

The text of a module's file, decoded as the platform decodes it: UTF-8, unless a byte order mark says another Unicode encoding, and without that mark.

public static string ReadText(byte[] bytes)

Parameters

bytes byte[]

The file's bytes.

Returns

string

Remarks

This is what ReadAllText(string) gives, the way the environment host and the language server read a module, so a client reads the same VERSION header they do: a header after a UTF-8 or UTF-16 mark is found, and the mark is no part of the text.