Table of Contents

Class RDCoreLanguageServerLaunch

Namespace
RDCore.SDK.Client
Assembly
RDCore.SDK.Protocol.dll

How to start the language server of a deployed platform, as a client that connects to it over a named pipe starts it: the pre-launch preparation an IDE does before it starts the server it registered.

public sealed class RDCoreLanguageServerLaunch
Inheritance
RDCoreLanguageServerLaunch
Inherited Members

Remarks

The language server listens on the pipe; the client starts the process and connects to it (an IDE's "pipeRole": "connect"). The command line is --pipe-name <pipe> --workspace <uri>, which is all the language server needs: it brings up the rest of the platform itself, from the manifest.

The platform root is given to the server explicitly (PlatformRootEnvironmentVariable), whatever the folder the IDE starts it in, and is inherited by every process it starts.

The executable is the one the manifest names, with or without .exe: a platform deployed on Windows names RDCore.LanguageServer.exe, which is RDCore.LanguageServer elsewhere. Every executable the manifest names is to be under the platform root, through whatever links the path goes: a manifest that names one elsewhere (.., an absolute path, a link out of the root) is refused, and nothing is started.

Fields

PlatformRootEnvironmentVariable

The environment variable that names the platform root to a process of the platform: RDCORE_PLATFORM_ROOT.

public const string PlatformRootEnvironmentVariable = "RDCORE_PLATFORM_ROOT"

Field Value

string

Properties

Arguments

Its arguments, one each: --pipe-name, --workspace, and --client-process-id when there is one.

public required IReadOnlyList<string> Arguments { get; init; }

Property Value

IReadOnlyList<string>

Environment

The environment variables to set for it, over the client's own.

public required IReadOnlyDictionary<string, string> Environment { get; init; }

Property Value

IReadOnlyDictionary<string, string>

ExecutablePath

The executable of the language server, as a full path.

public required string ExecutablePath { get; init; }

Property Value

string

Manifest

The platform manifest the language server was found from.

public required PlatformManifest Manifest { get; init; }

Property Value

PlatformManifest

PipeName

The pipe it listens on.

public required string PipeName { get; init; }

Property Value

string

PlatformRoot

The platform root, as a full path.

public required string PlatformRoot { get; init; }

Property Value

string

WorkingDirectory

The folder to start it in: its own.

public required string WorkingDirectory { get; init; }

Property Value

string

Methods

FindLanguageServer(string)

The language server of the platform at platformRoot, as Prepare(RDCoreLanguageServerLaunchOptions) would start it: the real path of the executable its manifest names, under the platform root, with or without .exe.

public static string FindLanguageServer(string platformRoot)

Parameters

platformRoot string

The platform root.

Returns

string

The language server's executable, as a full path.

Remarks

It tells whether a folder is a whole platform before anything is started, for a program that deploys one or offers one to a user.

Exceptions

DirectoryNotFoundException

The platform root does not exist.

FileNotFoundException

The platform root has no manifest, or the manifest names a language server that is not there.

InvalidDataException

The manifest is not one, names no language server, or names an executable that is not under the platform root, or one through a link that cannot be followed.

NewPipeName()

A new pipe name for a language server, one no other instance has: New(CoreServerComponent) of LanguageServer, short enough to be a pipe on every supported system.

public static string NewPipeName()

Returns

string

Prepare(RDCoreLanguageServerLaunchOptions)

Prepares the start of the language server of the platform at PlatformRoot.

public static RDCoreLanguageServerLaunch Prepare(RDCoreLanguageServerLaunchOptions options)

Parameters

options RDCoreLanguageServerLaunchOptions

The platform, the workspace, and the pipe.

Returns

RDCoreLanguageServerLaunch

How to start it.

Exceptions

ArgumentException

The workspace is not an absolute file: URI, nor an absolute path.

DirectoryNotFoundException

The platform root does not exist.

FileNotFoundException

The platform root has no manifest, or the manifest names a language server that is not there.

InvalidDataException

The manifest is not one, names no language server, or names an executable that is not under the platform root, or one through a link that can't be followed.

ReadManifest(string)

Reads the manifest of a platform root.

public static PlatformManifest ReadManifest(string platformRoot)

Parameters

platformRoot string

The platform root.

Returns

PlatformManifest

Exceptions

FileNotFoundException

The platform root has no manifest.

InvalidDataException

The manifest is not one.

ToProcessStartInfo()

The start of the language server as a ProcessStartInfo, for a client that starts it itself.

public ProcessStartInfo ToProcessStartInfo()

Returns

ProcessStartInfo