2024-10-31 17:16:47 +00:00
|
|
|
# JavaTXLanguageServer
|
2024-10-31 17:53:40 +00:00
|
|
|
This Repo contains the LanguageServer for JavaTX as well as various Clients to use it. <br>
|
|
|
|
It uses the LSP4J Framework in Version 0.23.1.
|
2024-10-31 17:16:47 +00:00
|
|
|
|
2024-10-31 17:53:40 +00:00
|
|
|
## Functionality
|
|
|
|
Currently the Language Server has the following functionalities:
|
|
|
|
- Syntax-Check
|
2024-11-19 15:23:30 +00:00
|
|
|
- Hovereffect that displays the current hovered Word
|
|
|
|
- Autocomplete for ForLoops and Main Method.
|
2024-11-06 16:26:13 +00:00
|
|
|
- Basic Autoformatting (removing every Space at the End of the Line)
|
2024-12-12 21:06:29 +00:00
|
|
|
- Display Type of Methods with TypeInference
|
2024-10-31 17:53:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
|
|
.
|
|
|
|
├── Client/
|
|
|
|
│ ├── VisualStudioCode -> Containing the Client for VS Code. In this Case a Extension.
|
|
|
|
│ ├── Eclipse
|
|
|
|
│ ├── Intellij
|
|
|
|
│ └── ...
|
|
|
|
└── LanguageServer/
|
2024-12-04 16:21:03 +00:00
|
|
|
└── src/main/java/de/dhbw/
|
|
|
|
├── compiler/ -> Containing the JavaTX Compiler
|
|
|
|
│ └── ...
|
2024-10-31 17:53:40 +00:00
|
|
|
├── model/
|
|
|
|
│ └── parseError/
|
|
|
|
│ └── ... -> Containing Custom Parse-Errors.
|
|
|
|
├── parser/
|
|
|
|
│ └── ... -> Containing an the JavaTX ANTLR Parser for Syntax-Checks.
|
2024-12-04 16:23:30 +00:00
|
|
|
├── helper/
|
|
|
|
│ └── ... -> Containing Helper-Classes for the Language Server.
|
2024-10-31 17:53:40 +00:00
|
|
|
├── JavaTXLanguageServer.java -> Orchestrator of the Language Server
|
|
|
|
├── JavaTXLanguageServerLauncher.java -> Class to start the Language Server.
|
|
|
|
├── JavaTXTextDocumentService.java -> Language-Server Features for a Single File
|
|
|
|
└── JavaTXWorkspaceService.java -> Language-Server Features for the Workspace
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
To use this Language Server you have to follow this steps:
|
|
|
|
1. Package the LanguageServer with ```maven:package```.
|
|
|
|
2. Open the VS-Code Client and run ```npm install```.
|
|
|
|
3. change Path in ```extensions.ts``` to absolute Path of your packaged Jar-File that you packaged in Step 1. (Line 20 and 24)
|
|
|
|
4. run ```npm run compile```
|
|
|
|
5. Go to Debug and Run the Extension.
|
|
|
|
6. Press F1 and execute the Hello World Command.
|
|
|
|
7. You can create .java Files which will be analysed by the Language Server.
|