88
99import * as path from 'path' ;
1010
11- import { workspace , ExtensionContext , extensions } from 'vscode' ;
11+ import { workspace , ExtensionContext , extensions , OutputChannel , window } from 'vscode' ;
1212import { LanguageClient , LanguageClientOptions , ServerOptions , TransportKind , NotificationType } from 'vscode-languageclient' ;
1313import { URI } from 'vscode-uri' ;
1414import { CUSTOM_SCHEMA_REQUEST , CUSTOM_CONTENT_REQUEST , SchemaExtensionAPI } from './schema-extension-api' ;
@@ -25,6 +25,8 @@ namespace DynamicCustomSchemaRequestRegistration {
2525 export const type : NotificationType < { } , { } > = new NotificationType ( 'yaml/registerCustomSchemaRequest' ) ;
2626}
2727
28+ let client : LanguageClient ;
29+
2830export function activate ( context : ExtensionContext ) {
2931 // The YAML language server is implemented in node
3032 let serverModule = context . asAbsolutePath ( path . join ( 'node_modules' , 'yaml-language-server' , 'out' , 'server' , 'src' , 'server.js' ) ) ;
@@ -57,7 +59,7 @@ export function activate(context: ExtensionContext) {
5759 } ;
5860
5961 // Create the language client and start it
60- let client = new LanguageClient ( 'yaml' , 'YAML Support' , serverOptions , clientOptions ) ;
62+ client = new LanguageClient ( 'yaml' , 'YAML Support' , serverOptions , clientOptions ) ;
6163 let disposable = client . start ( ) ;
6264
6365 const schemaExtensionAPI = new SchemaExtensionAPI ( client ) ;
@@ -131,3 +133,7 @@ function getSchemaAssociation(context: ExtensionContext): ISchemaAssociations {
131133
132134 return associations ;
133135}
136+
137+ export function logToExtensionOutputChannel ( message : string ) {
138+ client . outputChannel . appendLine ( message ) ;
139+ }
0 commit comments