From baac0777d7ba6f5cf59c6478fafd23155d773158 Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Wed, 23 Jul 2025 19:13:47 -0400 Subject: [PATCH] vscode: fix window file path issues we were using URI.path instead of URI.fsPath --- squawk-vscode/eslint.config.mjs | 7 +++++++ squawk-vscode/src/extension.ts | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/squawk-vscode/eslint.config.mjs b/squawk-vscode/eslint.config.mjs index b3f2abeb..6ebc1254 100644 --- a/squawk-vscode/eslint.config.mjs +++ b/squawk-vscode/eslint.config.mjs @@ -22,6 +22,13 @@ export default tseslint.config( rules: { "no-console": "error", "quotes": ["error", "double", { "avoidEscape": true }], + "no-restricted-syntax": [ + "error", + { + "selector": "MemberExpression[property.name='path']", + "message": "Use .fsPath instead of .path" + } + ], "@typescript-eslint/no-unused-vars": [ "error", { diff --git a/squawk-vscode/src/extension.ts b/squawk-vscode/src/extension.ts index 1eb1148c..bac1fc70 100644 --- a/squawk-vscode/src/extension.ts +++ b/squawk-vscode/src/extension.ts @@ -102,7 +102,7 @@ export async function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand("squawk.serverVersion", () => { try { const serverPath = getSquawkPath(context) - const stdout = execFileSync(serverPath.path, ["--version"], { + const stdout = execFileSync(serverPath.fsPath, ["--version"], { encoding: "utf8", }) const version = stdout.trim() @@ -252,15 +252,15 @@ async function startServer(context: vscode.ExtensionContext) { () => false, ) if (!hasBinary) { - const errorMsg = `Squawk binary not found at: ${squawkPath.path}` + const errorMsg = `Squawk binary not found at: ${squawkPath.fsPath}` log.error(`ERROR: ${errorMsg}`) vscode.window.showErrorMessage(errorMsg) return } - log.info(`Found Squawk binary at: ${squawkPath.path}`) + log.info(`Found Squawk binary at: ${squawkPath.fsPath}`) const serverExecutable: Executable = { - command: squawkPath.path, + command: squawkPath.fsPath, args: ["server", "--verbose"], } const serverOptions: ServerOptions = serverExecutable