LanguageServerRouter

Utility to setup an RPC connection via stdin/stdout and route all requests to methods defined in the given extension module.

Members

Aliases

members
alias members = ExtensionModule.members
Undocumented in source.
shutdownRequested
alias shutdownRequested = ExtensionModule.shutdownRequested
Undocumented in source.

Functions

gotNotify
void delegate() gotNotify(RequestMessageRaw msg)
Undocumented in source. Be warned that the author may not have intended to support it.
gotRequest
void delegate() gotRequest(RequestMessageRaw msg)
Undocumented in source. Be warned that the author may not have intended to support it.
processNotify
void processNotify(RequestMessageRaw msg)
Undocumented in source. Be warned that the author may not have intended to support it.
processRequest
ResponseMessageRaw processRequest(RequestMessageRaw msg)

Calls a method associated with the given request type in the

pushFiber
void pushFiber(T callback, int pages, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
run
bool run()

Runs the language server and returns true once it exited gracefully or false if it didn't exit gracefully.

runImpl
bool runImpl()

Same as run, assumes rpc is initialized and ready

Mixins

eventProcessor
mixin EventProcessor!(ExtensionModule, serverConfig.eventConfig) eventProcessor
Undocumented in source.

Static variables

fibers
FiberManager fibers;
Undocumented in source.
fibersMutex
Mutex fibersMutex;
Undocumented in source.
serverInitializeCalled
bool serverInitializeCalled;
Undocumented in source.

Variables

documents
TextDocumentManager documents;
Undocumented in source.
rpc
RPCProcessor rpc;
Undocumented in source.
shutdownRequested
bool shutdownRequested;
Undocumented in source.

Mixed In Members

From mixin EventProcessor!(ExtensionModule, serverConfig.eventConfig) eventProcessor

duplicates
enum duplicates;
Undocumented in source.
lintWarnings
enum lintWarnings;
Undocumented in source.
emitProtocol
bool emitProtocol(string method, string params, Args availableExtraArgs)

Calls all protocol methods in ExtensionModule matching a certain method and method type.

emitProtocolRaw
bool emitProtocolRaw(string method, string params)

Same as emitProtocol, but for the callback instead of getting a delegate to call, you get a function pointer and a tuple with the arguments for each instantiation that can be expanded.

emitExtensionEvent
bool emitExtensionEvent(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
iterateExtensionMethodsByUDA
bool iterateExtensionMethodsByUDA()

Iterates through all public methods in ExtensionModule annotated with the given UDA. For each matching function the callback paramter is called with the arguments being (string name, Delegate symbol, UDA uda). callback is expected to return a boolean if the UDA values were a match.

Parameters

ExtensionModule

a module defining the following members: - members: a compile time list of all members in all modules that should be introspected to be called automatically on matching RPC commands. - InitializeResult initialize(InitializeParams): initialization method.

Optional: - bool shutdownRequested: a boolean that is set to true before the shutdown method handler or earlier which will terminate the RPC loop gracefully and wait for an exit notification to actually exit. - @protocolMethod("shutdown") JsonValue shutdown(): the method called when the client wants to shutdown the server. Can return anything, recommended return value is JsonValue(null). - parallelMain: an optional method which is run alongside everything else in parallel using fibers. Should yield as much as possible when there is nothing to do.

Meta