Skip to content

Commit 49ae7b0

Browse files
authored
vscode: fix window file path issues (#595)
we were using URI.path instead of URI.fsPath rel: #594
1 parent b88bca6 commit 49ae7b0

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

squawk-vscode/eslint.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ export default tseslint.config(
2222
rules: {
2323
"no-console": "error",
2424
"quotes": ["error", "double", { "avoidEscape": true }],
25+
"no-restricted-syntax": [
26+
"error",
27+
{
28+
"selector": "MemberExpression[property.name='path']",
29+
"message": "Use .fsPath instead of .path"
30+
}
31+
],
2532
"@typescript-eslint/no-unused-vars": [
2633
"error",
2734
{

squawk-vscode/src/extension.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export async function activate(context: vscode.ExtensionContext) {
102102
vscode.commands.registerCommand("squawk.serverVersion", () => {
103103
try {
104104
const serverPath = getSquawkPath(context)
105-
const stdout = execFileSync(serverPath.path, ["--version"], {
105+
const stdout = execFileSync(serverPath.fsPath, ["--version"], {
106106
encoding: "utf8",
107107
})
108108
const version = stdout.trim()
@@ -252,15 +252,15 @@ async function startServer(context: vscode.ExtensionContext) {
252252
() => false,
253253
)
254254
if (!hasBinary) {
255-
const errorMsg = `Squawk binary not found at: ${squawkPath.path}`
255+
const errorMsg = `Squawk binary not found at: ${squawkPath.fsPath}`
256256
log.error(`ERROR: ${errorMsg}`)
257257
vscode.window.showErrorMessage(errorMsg)
258258
return
259259
}
260-
log.info(`Found Squawk binary at: ${squawkPath.path}`)
260+
log.info(`Found Squawk binary at: ${squawkPath.fsPath}`)
261261

262262
const serverExecutable: Executable = {
263-
command: squawkPath.path,
263+
command: squawkPath.fsPath,
264264
args: ["server", "--verbose"],
265265
}
266266
const serverOptions: ServerOptions = serverExecutable

0 commit comments

Comments
 (0)