Skip to content

Commit

Permalink
Merge pull request #528 from KxSystems/v.1.10.2-dev-to-main
Browse files Browse the repository at this point in the history
V.1.10.2 dev to main
  • Loading branch information
Philip-Carneiro-KX authored Feb 27, 2025
2 parents 0e379bf + c00f1cd commit 6a5f6cf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
15 changes: 12 additions & 3 deletions src/utils/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -124,9 +125,17 @@ export function convertResultToVector(result: any): any[] {
export async function exportToCsv(workspaceUri: Uri): Promise<void> {
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[] {
Expand Down

0 comments on commit 6a5f6cf

Please sign in to comment.