Skip to content

Commit 16c7d5b

Browse files
committed
added new setting
1 parent 3f88413 commit 16c7d5b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@
8787
"default": "",
8888
"scope": "machine"
8989
},
90+
"kdb.qHomeDirectoryWorkspace": {
91+
"type": "string",
92+
"description": "QHOME directory for q runtime for the workspace",
93+
"default": "",
94+
"scope": "resource"
95+
},
9096
"kdb.neverShowQInstallAgain": {
9197
"type": "boolean",
9298
"description": "Never show q install walkthrough again",

src/commands/setupTools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ async function setHome(home: string, folder?: vscode.ConfigurationScope) {
254254
/* c8 ignore start */
255255
const config = vscode.workspace.getConfiguration("kdb", folder);
256256
await config.update(
257-
"qHomeDirectory",
257+
folder ? "qHomeDirectoryWorkspace" : "qHomeDirectory",
258258
home,
259259
folder
260260
? vscode.ConfigurationTarget.WorkspaceFolder

src/utils/core.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,15 @@ export function getEnvironment(resource?: Uri): { [key: string]: string } {
228228
}
229229
}
230230

231-
const setting = workspace
231+
const qHomeDirectory = workspace
232232
.getConfiguration("kdb", resource)
233-
.inspect<string>("qHomeDirectory");
233+
.get<string>("qHomeDirectory", "");
234234

235-
const home =
236-
setting?.workspaceFolderValue || env.QHOME || setting?.globalValue || "";
235+
const qHomeDirectoryWorkspace = workspace
236+
.getConfiguration("kdb", resource)
237+
.get<string>("qHomeDirectoryWorkspace", "");
238+
239+
const home = qHomeDirectoryWorkspace || env.QHOME || qHomeDirectory || "";
237240

238241
if (home) {
239242
let q = path.resolve(home, "bin", "q");

0 commit comments

Comments
 (0)