Skip to content

Commit

Permalink
split channels
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Mar 24, 2024
1 parent 3bd0f00 commit 80a1424
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
12 changes: 8 additions & 4 deletions src/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import type Makensis from 'makensis/types';
import nsisChannel from './channel';
import { window } from 'vscode';

const infoChannel = window.createOutputChannel('NSIS Info', 'json');

export async function compilerOutput(data: Makensis.CompilerData): Promise<void> {
if (!data?.line) {
return;
Expand Down Expand Up @@ -87,8 +89,8 @@ export async function flagsCallback(data: unknown): Promise<void> {
: output
);

nsisChannel.append(message);
nsisChannel.show(true);
infoChannel.append(message);
infoChannel.show(true);
}

export async function versionCallback(data: unknown): Promise<void> {
Expand All @@ -101,7 +103,9 @@ export async function versionCallback(data: unknown): Promise<void> {
if (showVersionAsInfoMessage === true) {
window.showInformationMessage(message);
} else {
nsisChannel.append(message);
nsisChannel.show(true);
infoChannel.append(JSON.stringify({
version: message
}, null, 2));
infoChannel.show(true);
}
}
2 changes: 1 addition & 1 deletion src/channel.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { window } from 'vscode';

export default window.createOutputChannel('NSIS', 'makensis');
export default window.createOutputChannel('NSIS Compiler', 'makensis');
11 changes: 5 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { commands, type ExtensionContext, languages, window, workspace } from 'vscode';

// Load package components
import { compile, showCompilerFlags, showVersion, showHelp } from './makensis';
import { convert } from './nlf';
import { createTask } from './task';
import { updateDiagnostics } from './diagnostics';

export async function activate(context: ExtensionContext): Promise<void> {
const { compile, showCompilerFlags, showVersion, showHelp } = await import('./makensis');
const { convert } = await import('./nlf');
const { createTask } = await import ('./task');

context.subscriptions.push(
// TextEditor Commands
commands.registerTextEditorCommand('extension.nsis.compile', async () => {
Expand Down Expand Up @@ -44,6 +42,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
);

// Diagnostics
const { updateDiagnostics } = await import('./diagnostics');
const collection = languages.createDiagnosticCollection('nsis');

if (window.activeTextEditor) {
Expand Down

0 comments on commit 80a1424

Please sign in to comment.