-
Notifications
You must be signed in to change notification settings - Fork 1
LSP data collector
Data collection is necessary to be able to reply to LSP requests without the need to re-parse. During the parsing process, a component called the LSP info processor processes and stores this information. The main goal of this component is to collect as much information as possible to provide meaningful and complex replies to LSP requests while maintaining low memory and parse-time overheads.
The LSP info processor is invoked after each parsed and processed statement to collect and store the information it needs inside the LSP context (part of HLASM context).
The plugin implements four LSP language features:
-
hover The hover feature is invoked whenever a user moves his mouse cursor over a symbol for a short period of time. Typically a box with information about the selected symbol appears right next to it.
-
complete The complete feature can be triggered by a custom set of events such as typing a specific character. The server responds with a list of possible correct options that can be inserted into the particular position.
-
go_to_definition The go_to_definition feature is invoked manually from the editor by selecting a symbol and consequently invoking the
go_to_definition
command. The editor “jumps” to the location of the currently selected symbol’s definition by moving the cursor to that location. -
references The references feature is invoked in a similar manner to the go_to_definition feature. The results of the references feature are displayed as a list of all references to the selected symbol in the project, not just the definition of it.
The symbols for which the user might call the above mentioned LSP features are instruction symbols, variable symbols, sequence symbols and ordinary symbols.
The references and the go_to_definition features are very similar for each symbol type and in most cases work as described above.
However, there are two exceptions to the standard behavior of the go_to_definition feature. First, the command jumps to the definition of an instruction symbol only for macros (to the macro definition file). For the built-in instructions, the feature simply jumps to the first occurrence of the instruction. Second, the command used on an ordinary COPY symbol jumps to the corresponding copy file.
On the other hand, the responses to the hover and the complete features vary for each symbol type and are described in the following tables:
Symbol Type | Hover Contents |
---|---|
instruction | the type of the instruction, the syntax of its parameters the version (macros only), the documentation |
variable | the type of the variable — bool/string/number |
sequence | the position of the definition |
ordinary | absolute/relocatable, the value, the values of attributes |
(COPY) | the name of the copy file |
Symbol Type | Trigger Characters, Events | Response |
---|---|---|
instruction | A-Z,@,$,# after any number of spaces from the start of the line | built-in HLASM instructions + already used macros |
variable | & | variable symbols defined before the current line in the current scope |
sequence | . | sequence symbols defined before the current line |
ordinary | not implemented | not implemented |
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