diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ce54939..dea4c5cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to the **kdb VS Code extension** are documented in this file ### Enhancements - Semantic highlighting for local variables -- Display version of Insights server connected +- Display version of connected Insights server ### Fixes @@ -15,6 +15,7 @@ All notable changes to the **kdb VS Code extension** are documented in this file - Fix for Issue [#382](https://github.com/KxSystems/kx-vscode/issues/382) - Fix for run q file not using the current editor contents - Fix for autocomplete for new and unsaved documents +- Fix for results tab ### Internal Improvements diff --git a/server/src/parser/utils.ts b/server/src/parser/utils.ts index 1b9cc7da..fb2569e1 100644 --- a/server/src/parser/utils.ts +++ b/server/src/parser/utils.ts @@ -150,10 +150,6 @@ export function ordered(token: Token, next: Token) { return (token.order && next.order && next.order > token.order) || false; } -export function callable(token: Token) { - return token.assignment && token.assignment[1]?.tokenType === LCurly; -} - export function assigned(token: Token) { return token.assignment && token.assignment[1]; } diff --git a/src/extension.ts b/src/extension.ts index 1b973f3b..7b19412f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -471,7 +471,7 @@ export async function activate(context: ExtensionContext) { commands.registerCommand( "kdb.createDataSource", async (item: FileTreeItem) => { - if (hasWorkspaceOrShowOption()) { + if (hasWorkspaceOrShowOption("adding datasources")) { const uri = await addWorkspaceFile(item, "datasource", ".kdb.json"); if (uri) { @@ -501,7 +501,7 @@ export async function activate(context: ExtensionContext) { commands.registerCommand( "kdb.createScratchpad", async (item: FileTreeItem) => { - if (hasWorkspaceOrShowOption()) { + if (hasWorkspaceOrShowOption("adding workbooks")) { const uri = await addWorkspaceFile(item, "workbook", ".kdb.q"); if (uri) { await window.showTextDocument(uri); @@ -513,7 +513,7 @@ export async function activate(context: ExtensionContext) { commands.registerCommand( "kdb.createPythonScratchpad", async (item: FileTreeItem) => { - if (hasWorkspaceOrShowOption()) { + if (hasWorkspaceOrShowOption("adding workbooks")) { const uri = await addWorkspaceFile(item, "workbook", ".kdb.py"); if (uri) { await window.showTextDocument(uri); diff --git a/src/utils/core.ts b/src/utils/core.ts index a8577ffb..7584fdb6 100644 --- a/src/utils/core.ts +++ b/src/utils/core.ts @@ -635,12 +635,15 @@ export function formatTable(headers_: any, rows_: any, opts: any) { return result.join("\n"); } -export function hasWorkspaceOrShowOption() { +export function hasWorkspaceOrShowOption(action: string) { if (workspace.workspaceFolders && workspace.workspaceFolders.length > 0) { return true; } window - .showWarningMessage("No workspace folder is opened.", "Open") + .showWarningMessage( + `No workspace folder is open. Please open a folder to enable ${action}.`, + "Open", + ) .then((res) => { if (res === "Open") { commands.executeCommand("workbench.action.files.openFolder");