JavaTXLanguageServer
This Repo contains the LanguageServer for JavaTX as well as various Clients to use it.
It uses the LSP4J Framework in Version 0.23.1.
Functionality
Currently the Language Server has the following functionalities:
- Syntax-Check
- Autocomplete for ForLoops and Main Method.
- Basic Autoformatting (removing every Space at the End of the Line)
- Display Type of Methods and Parameters with TypeInference
- Select Type of typinfered Type and replace it (including Generics)
- Give Hint of all possible Types to Select from (including Generics)
- Compile Bytecode in /out Folder
Project Structure
.
├── Client/
│ ├── VisualStudioCode -> Containing the Client for VS Code. In this Case a Extension.
│ ├── Emacs
│ ├── Intellij
│ └── ...
└── LanguageServer/
└── src/main/java/de/dhbw/
├── compiler/ -> Containing the JavaTX Compiler
│ └── ...
├── model/
│ └── parseError/
│ └── ... -> Containing Custom Parse-Errors.
├── parser/
│ └── ... -> Containing an the JavaTX ANTLR Parser for Syntax-Checks.
├── helper/
│ └── ... -> Containing Helper-Classes for the Language Server.
├── 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
If you want to bundle and build the extension by yourself
To bundle and build the extension you can follow these steps:
- Package the LanguageServer with
maven:package
. - Open the VS-Code Client and run
npm install
. - run
npm run compile
- install vsce
npm install -g @vscode/vsce
- run
vsce package
and use the .vsix File as Extension in VS Code
Known Problems and what to do
- Currently the import statement after a selection of a type is not added. Please add it by yourself.
Logic
The Language Server in itself can be used for any Client. The Clients task is to start the Langauge Server and handle the Communication with it.
Update JavaTX Compiler Dependency as Maven Package
If you make changes in the Compiler Interface, you have to change the jar and therefore the Dependency in the Java TX Language Server You can follow this steps:
- package the JavaTX Compiler
- take the Jar-File and copy it into the /lib Folder
- execute this Maven command to add the Jar in your local Repository:
mvn install:install-file -Dfile=lib/JavaTXcompiler-0.1-jar-with-dependencies.jar -DgroupId=de.dhbwstuttgart -DartifactId=JavaTXcompiler -Dversion=0.1 -Dpackaging=jar
- run
maven clean
,validate
andinstall
to load the new Dependency - you can now package the Language Server or change the code accordingly.
Description
Reduce Result Set
Latest
Languages
Java
95%
TypeScript
4.2%
JavaScript
0.8%