Skip to content

Commit

Permalink
change default port to 25564
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 committed Mar 13, 2024
1 parent 12be3a6 commit 5e03fc1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
8 changes: 3 additions & 5 deletions editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@
"title": "GroovyScript",
"properties": {
"groovyscript.port": {
"type": [
"number"
],
"default": 8000,
"type": "number",
"default": 25564,
"title": "Language server port",
"description": "Port specified in config of GroovyScript Language Server"
"description": "Port to connect to GroovyScript mod"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let traceOutputChannel = vscode.window.createOutputChannel("GroovyScript Languag
async function startClient() {
const serverOptions = () => {
const configuration = vscode.workspace.getConfiguration("groovyscript");
const port = configuration.get<number>("port", 8000);
let port = configuration.get<number>("port", 25564);
outputChannel.appendLine(`Connecting to GroovyScript Language Server at port ${port}`);
let socket = net.connect({port: port});
socket.on("error", (err) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ public class GroovyScriptConfig {
@ApiStatus.Internal
@Config.Comment("The current set packmode")
public static String packmode = "";

@Config.Comment("Port for the VSC connection. Default: 25564")
public static int languageServerPort = 25564;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.cleanroommc.groovyscript.server;

import com.cleanroommc.groovyscript.GroovyScript;
import com.cleanroommc.groovyscript.GroovyScriptConfig;
import com.cleanroommc.groovyscript.api.GroovyLog;
import net.prominic.groovyls.GroovyLanguageServer;
import org.eclipse.lsp4j.jsonrpc.Launcher;
Expand All @@ -17,7 +18,7 @@ public static void listen() {

while (true) {
var server = new GroovyScriptLanguageServer(languageServerContext);
try (var serverSocket = new ServerSocket(8000);
try (var serverSocket = new ServerSocket(GroovyScriptConfig.languageServerPort);
var socket = serverSocket.accept()) {

GroovyScript.LOGGER.info("Accepted connection from: {}", socket.getInetAddress());
Expand Down

0 comments on commit 5e03fc1

Please sign in to comment.