Language Server API

The Language Server API provides a WebSocket API the end user can connect to. The WebSocket API allows a bidirectional communication which can be seen as a favourable model over a REST API.

Client Requests

The Language Server (LS) will operate on a specific port (specified in the configuration of the server) and allows N clients to connect. When a client connected the client has the possibility to request certain information from the Language Server:

RequestContent TypeDescription
/request_protocoltext/jsonThis will return the language protocol (Noodle Language Specification)

Client Events

The Client can send the following events to the LS:

Client EventsContent TypeDescription
/document_changedtext/jsonThis tells the server that the document has changed. The body contains the changed document. The reaction of this message is implementation defined.

Server Events

The LS can update the client with:

LS UpdateContent TypeDescription
/protocol_changedtext/jsonThis tells the client the protocol has changed. The new protocol will be in the body. (Noodle Language Specification)
/errortext/jsonThis will return a error object that describes in its type field what kind of error and the error message can be accessed in the message.
/runstext/jsonOptional. It existences is implementation defined. This can be used to signal the client that the X files are in simulations. Could be used to implement hot reload / live changes together with /document_changed.

Example Communication

The user changes a graph and sends /document_changed to the server the server will apply the changes to the VM. The server will return the validation results via /error if there has been a error otherwiese nothing will be send to the user.