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 outputChannel : OutputChannel ;
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' ) ) ;
@@ -131,3 +133,10 @@ function getSchemaAssociation(context: ExtensionContext): ISchemaAssociations {
131133
132134 return associations ;
133135}
136+
137+ export function logToExtensionOutputChannel ( message : string ) {
138+ if ( outputChannel === undefined ) {
139+ outputChannel = window . createOutputChannel ( 'VS Code Yaml extension' ) ;
140+ }
141+ outputChannel . appendLine ( message ) ;
142+ }
0 commit comments