aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2025-08-16 11:48:31 +0200
committerGitHub <noreply@github.com>2025-08-16 11:48:31 +0200
commit87684b48739c65c7321238f7da8bc6adc9f67751 (patch)
tree1b40f837710ac666c213e86f931b074f39ad54c0 /editors
parent788d55173318f0456c985560e84aeb2eaac86465 (diff)
parentd65dc9ed8dfad4df4bceaa0b90f5f6b71d0a5827 (diff)
Merge pull request #872 from BradLewis/fix/vscode-extension-odin-command
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