From 73da94c2e7f2829d6b8fe760903983f814759c9b Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Thu, 27 Feb 2025 14:35:57 +0000 Subject: [PATCH 1/2] fix issue with clients envs --- src/utils/execution.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/utils/execution.ts b/src/utils/execution.ts index a3670073..b504690c 100644 --- a/src/utils/execution.ts +++ b/src/utils/execution.ts @@ -16,6 +16,7 @@ import path from "path"; import { Uri, window, workspace } from "vscode"; import { ext } from "../extensionVariables"; import { QueryResultType } from "../models/queryResult"; +import { kdbOutputLog } from "./core"; interface tblHeader { label: string; @@ -124,9 +125,17 @@ export function convertResultToVector(result: any): any[] { export async function exportToCsv(workspaceUri: Uri): Promise { const timestamp = Date.now(); const fileName = `results-${timestamp}.csv`; - const filePath = Uri.parse(path.join(workspaceUri.fsPath, fileName)); - await workspace.fs.writeFile(filePath, Buffer.from(ext.resultPanelCSV)); - window.showTextDocument(filePath, { preview: false }); + const filePath = Uri.file(path.join(workspaceUri.fsPath, fileName)); + + try { + await workspace.fs.writeFile(filePath, Buffer.from(ext.resultPanelCSV)); + kdbOutputLog("file located at: " + filePath.fsPath, "INFO"); + window.showTextDocument(filePath, { preview: false }); + } catch (error) { + const errorMessage = error instanceof Error ? error.message : String(error); + kdbOutputLog(`Error writing file: ${errorMessage}`, "ERROR"); + window.showErrorMessage(`Failed to write file: ${errorMessage}`); + } } export function convertArrayOfArraysToObjects(arr: any): any[] { From c00f1cda44b165d7b36bc13d83ee27029b8b38d4 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Thu, 27 Feb 2025 14:38:37 +0000 Subject: [PATCH 2/2] update version and docs --- CHANGELOG.md | 6 ++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 211dfdb4..823fdb81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the **kdb VS Code extension** are documented in this file. +# v1.10.2 + +### Fixes + +- Resolved issue with export csv method + # v1.10.1 ### Fixes diff --git a/package-lock.json b/package-lock.json index 547daf3b..8ca0750e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kdb", - "version": "1.10.1", + "version": "1.10.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kdb", - "version": "1.10.1", + "version": "1.10.2", "license": "MIT", "dependencies": { "@ag-grid-community/core": "^32.3.3", diff --git a/package.json b/package.json index c6daf4fb..455723da 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "kdb", "description": "IDE support for kdb product suite including the q programming language", "publisher": "KX", - "version": "1.10.1", + "version": "1.10.2", "engines": { "vscode": "^1.86.0" },