docs/language-server/protocol-common.md
This document contains the specification of the Enso protocol messages that are common to multiple sub-components of the protocol.
For information on the design and architecture of the protocol, as well as its transport formats, please look here.
<!-- MarkdownTOC levels="2,3" autolink="true" --> <!-- /MarkdownTOC -->The message specification for protocol messages must include the following fields:
Client -> Server or Server -> Client).They must also contain separate sections specifying their parameters, result (if it has one), and any errors that may occur. These specifications should be either in typescript or flatbuffers syntax, depending on the connection on which the message occurs.
The capability specifications must include the following fields, as well as a section 'Enables' stating which protocol messages are gated by the capability.
There are a number of types that are shared between many of the protocol messages. They are specified below.
PathA path is a representation of a path relative to a specified content root.
Please note that segments can only be ordinary file names, .. and . may not
be supported.
interface Path {
rootId: UUID;
segments: [String];
}
namespace org.enso.languageserver.protocol.binary;
//A representation of a path relative to a specified content root.
table Path {
//a content root id that the path is relative to
rootId: EnsoUUID;
//path segments
segments: [string];
}
IPWithSocketA IPWithSocket is an endpoint for communication between machines.
interface IPWithSocket {
host: String;
port: Int;
}
EnsoUUIDAn EnsoUUID is a value object containing 128-bit universally unique identifier.
namespace org.enso.languageserver.protocol.binary;
//A binary representation of universally unique identifiers.
struct EnsoUUID {
//The most significant bits of the UUID.
leastSigBits:uint64;
//The most significant bits of the UUID.
mostSigBits:uint64;
}
ParseErrorSignals that the message failed to parse.
"error" : {
"code" : -32700,
"message" : "Parse error"
}
InvalidRequestSignals that the request is invalid.
"error" : {
"code" : -32600,
"message" : "Invalid Request"
}
MethodNotFoundSignals that the requested method is not supported.
"error" : {
"code" : -32601,
"message" : "Method not found"
}
InvalidParamsSignals that the parameters provided for the requested method were invalid.
This may indicate that the type or format of one of the parameters is different than expected.
"error" : {
"code" : -32602,
"message" : "Invalid params"
}
ServiceErrorSignals a generic service error.
"error" : {
"code" : 1,
"message" : "Service error"
}
NotImplementedErrorSignals that the requested method is supported, but it is has not been implemented yet.
"error" : {
"code" : 10,
"message" : "The requested method is not implemented"
}
RequestTimeoutErrorSignals that request exceeded the waiting time.
"error" : {
"code" : 11,
"message" : "Request timeout"
}