feat: renaming

This commit is contained in:
Ruben 2024-10-31 18:37:51 +01:00
parent d3df6d5dab
commit 1583fa254d
19 changed files with 25 additions and 90 deletions

View File

@ -53,7 +53,7 @@
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.example.MyLanguageServerLauncher</mainClass> <!-- Deine Main-Klasse -->
<mainClass>com.dhbw.JavaTXLanguageServerLauncher</mainClass> <!-- Deine Main-Klasse -->
</manifest>
</archive>
</configuration>

View File

@ -1,4 +1,4 @@
package com.example;
package com.dhbw;
import org.eclipse.lsp4j.*;
import org.eclipse.lsp4j.services.LanguageClient;
@ -9,7 +9,7 @@ import org.eclipse.lsp4j.services.LanguageServer;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class MyLanguageServer implements LanguageServer {
public class JavaTXLanguageServer implements LanguageServer {
private LanguageClient client;
public void connect(LanguageClient client) {
@ -18,8 +18,8 @@ public class MyLanguageServer implements LanguageServer {
}
private final MyTextDocumentService textDocumentService = new MyTextDocumentService();
private final MyWorkspaceService workspaceService = new MyWorkspaceService();
private final JavaTXTextDocumentService textDocumentService = new JavaTXTextDocumentService();
private final JavaTXWorkspaceService workspaceService = new JavaTXWorkspaceService();
@Override
public CompletableFuture<InitializeResult> initialize(InitializeParams params) {

View File

@ -1,15 +1,14 @@
package com.example;
package com.dhbw;
import org.eclipse.lsp4j.launch.LSPLauncher;
import org.eclipse.lsp4j.jsonrpc.Launcher;
import org.eclipse.lsp4j.services.LanguageClient;
public class MyLanguageServerLauncher {
public class JavaTXLanguageServerLauncher {
public static void main(String[] args) {
try {
MyLanguageServer server = new MyLanguageServer();
JavaTXLanguageServer server = new JavaTXLanguageServer();
var launcher = LSPLauncher.createServerLauncher(server, System.in, System.out);

View File

@ -1,22 +1,17 @@
package com.example;
package com.dhbw;
import com.example.model.ParseError.CustomErrorListener;
import com.example.model.ParseError.ParseException;
import com.example.parser.ErrorListener;
import com.example.parser.Java17Lexer;
import com.example.parser.Java17Parser;
import com.example.parser.Java17ParserBaseListener;
import com.dhbw.model.ParseError.DiagnoseErrorListener;
import com.dhbw.parser.Java17Lexer;
import com.dhbw.parser.Java17Parser;
import com.dhbw.parser.Java17ParserBaseListener;
import org.eclipse.lsp4j.*;
import org.eclipse.lsp4j.jsonrpc.messages.Either;
import org.eclipse.lsp4j.jsonrpc.messages.Message;
import org.eclipse.lsp4j.services.LanguageClient;
import org.eclipse.lsp4j.services.LanguageServer;
import org.eclipse.lsp4j.services.TextDocumentService;
import java.util.Collections;
import java.util.concurrent.CompletableFuture;
import java.util.List;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicReference;
import org.antlr.v4.runtime.CharStreams;
@ -25,7 +20,7 @@ import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
public class MyTextDocumentService implements org.eclipse.lsp4j.services.TextDocumentService {
public class JavaTXTextDocumentService implements org.eclipse.lsp4j.services.TextDocumentService {
LanguageClient client;
public void setClient(LanguageClient client) {
@ -47,7 +42,7 @@ public class MyTextDocumentService implements org.eclipse.lsp4j.services.TextDoc
AtomicReference<String> summedUp = new AtomicReference<>("");
params.getContentChanges().forEach(el -> summedUp.set(summedUp.get() + el.getText()));
CustomErrorListener errorListener = new CustomErrorListener();
DiagnoseErrorListener errorListener = new DiagnoseErrorListener();
String input = summedUp.get();
CharStream charStream = CharStreams.fromString(input);

View File

@ -1,16 +1,10 @@
package com.example;
package com.dhbw;
import org.eclipse.lsp4j.DidChangeConfigurationParams;
import org.eclipse.lsp4j.WorkspaceSymbolParams;
import org.eclipse.lsp4j.SymbolInformation;
import org.eclipse.lsp4j.services.WorkspaceService;
import org.eclipse.lsp4j.DidChangeWatchedFilesParams;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.ArrayList;
public class MyWorkspaceService implements WorkspaceService {
public class JavaTXWorkspaceService implements WorkspaceService {
@Override

View File

@ -1,19 +1,15 @@
package com.example.model.ParseError;
package com.dhbw.model.ParseError;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.atn.ATNConfigSet;
import org.antlr.v4.runtime.dfa.DFA;
import org.eclipse.lsp4j.*;
import org.eclipse.lsp4j.jsonrpc.messages.Either;
import org.eclipse.lsp4j.services.LanguageClient;
import org.eclipse.lsp4j.services.LanguageServer;
import org.eclipse.lsp4j.services.TextDocumentService;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
public class CustomErrorListener implements ANTLRErrorListener {
public class DiagnoseErrorListener implements ANTLRErrorListener {
private final List<Diagnostic> errorMessages = new ArrayList<>();
@Override
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) {

View File

@ -1,12 +1,9 @@
package com.example.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Lexer.g4 by ANTLR 4.13.1
package com.dhbw.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Lexer.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"})
public class Java17Lexer extends Lexer {

View File

@ -1,12 +1,9 @@
package com.example.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
package com.dhbw.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"})
public class Java17Parser extends Parser {

View File

@ -1,4 +1,4 @@
package com.example.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
package com.dhbw.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ErrorNode;

View File

@ -1,4 +1,4 @@
package com.example.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
package com.dhbw.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
/**

View File

@ -1,4 +1,4 @@
package com.example.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
package com.dhbw.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**

View File

@ -1,4 +1,4 @@
package com.example.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
package com.dhbw.parser;// Generated from /home/ruben/Documents/JavaCompilerCore/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 by ANTLR 4.13.1
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
/**

View File

@ -1,10 +0,0 @@
package com.example.model.ParseError;
public class ParseError {
private String message;
private int line;
private int charposition;
public ParseError(int line, int charPositionInLine, String msg) {
}
}

View File

@ -1,15 +0,0 @@
package com.example.model.ParseError;
public class ParseException extends RuntimeException {
private int line;
private int charposition;
public ParseException(String message, int line, int charposition) {
super(message);
this.line = line;
this.charposition = charposition;
}
public int getLine() {return line;}
public int getCharposition() {return charposition;}
}

View File

@ -1,18 +0,0 @@
package com.example.parser;
import com.example.model.ParseError.ParseError;
import com.example.model.ParseError.ParseException;
import org.antlr.v4.runtime.BaseErrorListener;
import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Recognizer;
public class ErrorListener extends BaseErrorListener {
@Override
public void syntaxError(Recognizer<?, ?> recognizer,
Object offendingSymbol,
int line, int charPositionInLine,
String msg,
RecognitionException e) {
throw new ParseException(msg, line, charPositionInLine);
}
}