Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/views/results/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ async function runHandler(options?: StatementInfo) {
vscode.commands.executeCommand('vscode-db2i.dove.close');

if (optionsIsValid || (editor && editor.document.languageId === `sql`)) {
const eol = editor.document.eol === vscode.EndOfLine.CRLF ? `\r\n` : `\n`;
let chosenView = resultSetProvider;

const useWindow = (title: string, column?: ViewColumn) => {
Expand Down Expand Up @@ -426,8 +427,10 @@ async function runHandler(options?: StatementInfo) {
const result = await JobManager.runSQLVerbose(statementDetail.content, undefined, 1);
setCancelButtonVisibility(false);
updateStatusBar({executing: false});

const statement = statementDetail.content.split(eol).map((line, index) => index === 0 ? line : `// ${line}`).join(eol);
let content = `**free\n\n`
+ `// statement: ${statementDetail.content}\n\n`
+ `// statement: ${statement}\n\n`
+ `// Row data structure\n`
+ queryResultToRpgDs(result, Configuration.get(`codegen.rpgSymbolicNameSource`));
const textDoc = await vscode.workspace.openTextDocument({ language: 'rpgle', content });
Expand Down
Loading