-
Notifications
You must be signed in to change notification settings - Fork 26
LSP and DAP server
The servers are able to process incoming LSP and DAP requests. They get the messages in the form of already parsed JSONs. Then they extract the name of the requested method with its parameters from the message and call the corresponding method with the parameters encoded in JSON format.
There are two server implementations: lsp_server
and dap_server
. Both inherit from an abstract class called server
. They implement protocol-specific processing of messages — although the protocols are quite similar (both are based on RPC), each protocol has a different initialization and finalization, different message format, etc.
The functionality of servers is divided into features
. Each feature implements several LSP or DAP methods by unpacking the arguments of the respective method and calling the corresponding parser library function. During initialization, each feature adds its methods to the server’s list of implemented methods. The lsp_server
uses three features:
-
Text synchronization feature, which handles the notifications about the state of open files in the editor.
-
Workspace folders feature, which handles the notifications about adding and removing workspaces.
-
Language feature, which handles requests about HLASM code information.
The following table shows the list of all implemented LSP methods and the classes where the implementations lie.
Component | LSP Method Name |
---|---|
lsp_server |
initialize shutdown exit textDocument/publishDiagnostics |
Text synchronization feature | textDocument/didOpen textDocument/didChange textDocument/didClose textDocument/semanticHighlighting |
Workspace folders feature | workspace/didChangeWorkspaceFolders workspace/didChangeWatchedFiles |
Language feature | textDocument/definition textDocument/references textDocument/hover textDocument/completion |
|
The DAP server uses only one feature — the dap feature, which handles stepping through the code and retrieving information about both variables and stack trace. The following table shows the list of all implemented DAP methods:
Class | DAP Method Name |
---|---|
dap_feature |
initialize disconnect launch setBreakpoints configurationDone threads stackTrace scopes next stepIn variables continue stopped exited terminated
|
|
According to the LSP and the DAP, the server is required to send messages back to the LSP/DAP client either as responses to requests (e.g. hover
), notifications (e.g. textDocument/publishDiagnostics notification) or events (e.g. stopped event). Features require reference to an instance of the response_provider
interface that provides methods respond
and notify
for sending messages back to the LSP client. Both LSP and DAP server classes implement the response_provider
to form protocol-specific JSON with the arguments.
The servers then send the JSON to the LSP/DAP client using the send_message_provider
interface. At this point, the final complete JSON response is formed. The send_message_provider
then adds the message header and serializes the JSON using the JSON for Modern C++ library (see third party libraries).
The only implementation of the send_message_provider
interface is the dispatcher
.
I. Project overview
II. Component description
-
Language server
4.1 LSP and DAP
4.2 Language server overview
4.3 IO handling
4.4 LSP and DAP server
4.5 Request manager -
Workspace manager
5.1 Parser library API
5.2 Libraries configuration
5.3 Workspace manager overview -
Analyzer
6.1. LSP data collector
6.2. Processing manager
6.2.1 Statement providers
6.2.2 Statement processors
6.2.3 Instruction processors
6.2.4 Expressions
6.3. Instruction format validation
6.4. Lexer
6.5. Parser
6.6. HLASM context tables - Macro tracer
- Extension
III. Dependencies and Build Instructions