Skip to content

Commit b84cad0

Browse files
committed
CL execution output
1 parent 16d95a2 commit b84cad0

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/language/results/index.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,6 @@ exports.initialise = (context) => {
8888
const statement = this.parseStatement(editor);
8989

9090
if (statement.content.trim().length > 0) {
91-
92-
statement.content = [
93-
`SET CURRENT SCHEMA = '${config.currentLibrary.toUpperCase()}'`,
94-
statement.content
95-
].join(`;\n`);
96-
9791
try {
9892
if (statement.type === `cl`) {
9993
const commandResult = await vscode.commands.executeCommand(`code-for-ibmi.runCommand`, {
@@ -111,8 +105,18 @@ exports.initialise = (context) => {
111105
if (commandResult.stderr.length > 0) output += `${commandResult.stderr}\n\n`;
112106
if (commandResult.stdout.length > 0) output += `${commandResult.stdout}\n\n`;
113107

114-
// TODO: CompileTools.appendOutput(output);
108+
const textDoc = await vscode.workspace.openTextDocument({language: `txt`, content: output});
109+
await vscode.window.showTextDocument(textDoc, {
110+
preserveFocus: true,
111+
preview: true
112+
});
113+
115114
} else {
115+
statement.content = [
116+
`SET CURRENT SCHEMA = '${config.currentLibrary.toUpperCase()}'`,
117+
statement.content
118+
].join(`;\n`);
119+
116120
if (statement.type === `statement`) {
117121
resultSetProvider.setLoadingText(`Executing statement...`);
118122
}

0 commit comments

Comments
 (0)