diff --git a/package.json b/package.json index 065330d2..6b363c63 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ { "id": "install", "title": "Register, acquire license and download the q runtime", - "description": " \n[Install runtime](command:kdb.installTools)\n[Ignore/hide this help](command:kdb.hideWalkthrough)", + "description": " \n[Install runtime](command:kdb.installTools)", "media": { "image": "resources/kx_install.png", "altText": "register" @@ -67,7 +67,7 @@ { "id": "view", "title": "q runtime installed", - "description": " \n[Ignore/hide this help](command:kdb.hideWalkthrough)", + "description": " \n", "media": { "markdown": "out/qinstall.md" }, @@ -467,13 +467,13 @@ "command": "kdb.execute.block", "key": "ctrl+shift+e", "mac": "cmd+shift+e", - "when": "editorLangId == q && !(resourceFilename =~ /.kdb.q/)" + "when": "editorLangId == q" }, { "command": "kdb.toggleParameterCache", "key": "ctrl+shift+y", "mac": "cmd+shift+y", - "when": "editorLangId == q && !(resourceFilename =~ /.kdb.q/)" + "when": "editorLangId == q" } ], "snippets": [ diff --git a/src/extension.ts b/src/extension.ts index e0bcd150..b35dca5a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -465,16 +465,32 @@ export async function activate(context: ExtensionContext) { }), commands.registerCommand("kdb.renameFile", async (item: FileTreeItem) => { if (item && item.resourceUri) { - const document = await workspace.openTextDocument(item.resourceUri); - await window.showTextDocument(document); + if (item.resourceUri.path.endsWith(".kdb.json")) { + await commands.executeCommand( + "vscode.openWith", + item.resourceUri, + DataSourceEditorProvider.viewType, + ); + } else { + const document = await workspace.openTextDocument(item.resourceUri); + await window.showTextDocument(document); + } await commands.executeCommand("revealInExplorer"); await commands.executeCommand("renameFile"); } }), commands.registerCommand("kdb.deleteFile", async (item: FileTreeItem) => { if (item && item.resourceUri) { - const document = await workspace.openTextDocument(item.resourceUri); - await window.showTextDocument(document); + if (item.resourceUri.path.endsWith(".kdb.json")) { + await commands.executeCommand( + "vscode.openWith", + item.resourceUri, + DataSourceEditorProvider.viewType, + ); + } else { + const document = await workspace.openTextDocument(item.resourceUri); + await window.showTextDocument(document); + } await commands.executeCommand("revealInExplorer"); await commands.executeCommand("deleteFile"); }