Skip to content

Commit 6a7f1ee

Browse files
committed
Reuse the output channel of the Language Client #326
Signed-off-by: Aurélien Pupier <apupier@redhat.com>
1 parent b8594ec commit 6a7f1ee

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/extension.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace DynamicCustomSchemaRequestRegistration {
2525
export const type: NotificationType<{}, {}> = new NotificationType('yaml/registerCustomSchemaRequest');
2626
}
2727

28-
let outputChannel: OutputChannel;
28+
let client: LanguageClient;
2929

3030
export function activate(context: ExtensionContext) {
3131
// The YAML language server is implemented in node
@@ -59,7 +59,7 @@ export function activate(context: ExtensionContext) {
5959
};
6060

6161
// Create the language client and start it
62-
let client = new LanguageClient('yaml', 'YAML Support', serverOptions, clientOptions);
62+
client = new LanguageClient('yaml', 'YAML Support', serverOptions, clientOptions);
6363
let disposable = client.start();
6464

6565
const schemaExtensionAPI = new SchemaExtensionAPI(client);
@@ -135,8 +135,5 @@ function getSchemaAssociation(context: ExtensionContext): ISchemaAssociations {
135135
}
136136

137137
export function logToExtensionOutputChannel(message: string) {
138-
if(outputChannel === undefined){
139-
outputChannel = window.createOutputChannel('VS Code Yaml extension');
140-
}
141-
outputChannel.appendLine(message);
138+
client.outputChannel.appendLine(message);
142139
}

0 commit comments

Comments
 (0)