Jelajahi Sumber

Adjust Godot version detection regex (#526)

* Adjust Godot version detection regex

Signed-off-by: mlsvrts <[email protected]>
mlsvrts 1 tahun lalu
induk
melakukan
f65033c626

+ 1 - 1
src/debugger/godot3/server_controller.ts

@@ -109,7 +109,7 @@ export class ServerController {
 		try {
 			log.info(`Verifying version of '${godotPath}'`);
 			const output = execSync(`${godotPath} --version`).toString().trim();
-			const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?\w+.\w+.[0-9a-f]{9}/;
+			const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?(?:\w+\.)+[0-9a-f]{9}/;
 			const match = output.match(pattern);
 			if (!match) {
 				const message = `Cannot launch debug session: '${settingName}' of '${godotPath}' is not a valid Godot executable`;

+ 1 - 1
src/debugger/godot4/server_controller.ts

@@ -110,7 +110,7 @@ export class ServerController {
 		try {
 			log.info(`Verifying version of '${godotPath}'`);
 			const output = execSync(`${godotPath} --version`).toString().trim();
-			const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?\w+.\w+.[0-9a-f]{9}/;
+			const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?(?:\w+\.)+[0-9a-f]{9}/;
 			const match = output.match(pattern);
 			if (!match) {
 				const message = `Cannot launch debug session: '${settingName}' of '${godotPath}' is not a valid Godot executable`;

+ 1 - 1
src/extension.ts

@@ -93,7 +93,7 @@ function open_workspace_with_editor() {
 
 	try {
 		const output = execSync(`${godotPath} --version`).toString().trim();
-		const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?\w+.\w+.[0-9a-f]{9}/;
+		const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?(?:\w+\.)+[0-9a-f]{9}/;
 		const match = output.match(pattern);
 		if (!match) {
 			const message = `Cannot launch Godot editor: '${settingName}' of '${godotPath}' is not a valid Godot executable`;

+ 1 - 1
src/lsp/ClientConnectionManager.ts

@@ -110,7 +110,7 @@ export class ClientConnectionManager {
 
 		try {
 			const output = execSync(`${godotPath} --version`).toString().trim();
-			const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?\w+.\w+.[0-9a-f]{9}/;
+			const pattern = /([34])\.([0-9]+)\.(?:[0-9]+\.)?(?:\w+\.)+[0-9a-f]{9}/;
 			const match = output.match(pattern);
 			if (!match) {
 				const message = `Cannot launch headless LSP: '${settingName}' of '${godotPath}' is not a valid Godot executable`;