summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-13 09:13:08 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-13 20:35:03 -0400
commitd65dc9ed8dfad4df4bceaa0b90f5f6b71d0a5827 (patch)
treec66e900be61d13c9718fc6f6eab1af363365c300 /editors
parentdfdeeaec1b52b6c3c66d224ee6433aad47903afd (diff)
Fix issue with vscode extension incorrectly concatenating paths when using `odin_command`
Diffstat (limited to 'editors')
-rw-r--r--editors/vscode/package.json2
-rw-r--r--editors/vscode/src/toolchain.ts24
2 files changed, 6 insertions, 20 deletions
diff --git a/editors/vscode/package.json b/editors/vscode/package.json
index 405b4af..51df9b2 100644
--- a/editors/vscode/package.json
+++ b/editors/vscode/package.json
@@ -7,7 +7,7 @@
"type": "git",
"url": "git://github.com/DanielGavin/ols.git"
},
- "version": "0.1.39",
+ "version": "0.1.40",
"engines": {
"vscode": "^1.96.0"
},
diff --git a/editors/vscode/src/toolchain.ts b/editors/vscode/src/toolchain.ts
index d62f6ba..1e7c93a 100644
--- a/editors/vscode/src/toolchain.ts
+++ b/editors/vscode/src/toolchain.ts
@@ -1,19 +1,15 @@
-import * as vscode from "vscode";
import * as os from "os";
import * as path from "path";
import * as fs from "fs";
-import { execute, log, memoize } from './util';
+import { memoize } from './util';
import { Config } from "./config";
export function isOdinInstalled(config: Config): boolean {
- return vscode.workspace.workspaceFolders?.some(folder => {
- if (config.odinCommand) {
- let command = path.isAbsolute(config.odinCommand) ? config.odinCommand :
- path.join(folder.uri.fsPath, config.odinCommand);
- return isFile(command) && fs.existsSync(command);
- }
- }) || getPathForExecutable("odin") !== "";
+ if (config.odinCommand) {
+ return true
+ }
+ return getPathForExecutable("odin") !== "";
}
export const getPathForExecutable = memoize(
@@ -58,13 +54,3 @@ function lookupInPath(exec: string): string | undefined {
return undefined;
}
-
-function isFile(suspectPath: string): boolean {
- // It is not mentionned in docs, but `statSync()` throws an error when
- // the path doesn't exist
- try {
- return fs.statSync(suspectPath).isFile();
- } catch {
- return false;
- }
-} \ No newline at end of file