@@ -116,22 +116,6 @@ export function getServerPlatform() : ServerPlatform {
116116 }
117117}
118118
119- function notifyConfigurationChange ( context : vscode . ExtensionContext , client : LanguageClient ) {
120- context . subscriptions . push (
121- vscode . workspace . onDidChangeConfiguration ( async ( event : vscode . ConfigurationChangeEvent ) => {
122- if ( event . affectsConfiguration ( "shader-validator" ) ) {
123- if ( event . affectsConfiguration ( "shader-validator.trace.server" ) ||
124- event . affectsConfiguration ( "shader-validator.serverPath" ) ) {
125- //restartServer();
126- }
127- await client . sendNotification ( DidChangeConfigurationNotification . type , {
128- settings : "" ,
129- } ) ;
130- }
131- } )
132- ) ;
133- }
134-
135119function getMiddleware ( ) : Middleware {
136120 return {
137121 async provideDocumentSymbols ( document : vscode . TextDocument , token : vscode . CancellationToken , next : ProvideDocumentSymbolsSignature ) {
@@ -194,6 +178,10 @@ export async function createLanguageClient(context: vscode.ExtensionContext): Pr
194178 }
195179}
196180async function createLanguageClientStandard ( context : vscode . ExtensionContext , platform : ServerPlatform ) : Promise < LanguageClient | null > {
181+ const channelName = 'Shader language Server' ; // For trace option, need same name
182+ const channel = vscode . window . createOutputChannel ( channelName ) ;
183+ context . subscriptions . push ( channel ) ;
184+
197185 const executable = getPlatformBinaryUri ( context . extensionUri , platform ) ;
198186 const cwd = getPlatformBinaryDirectoryPath ( context . extensionUri , platform ) ;
199187 console . info ( `Executing server ${ executable } with working directory ${ cwd } ` ) ;
@@ -223,13 +211,14 @@ async function createLanguageClientStandard(context: vscode.ExtensionContext, pl
223211 { scheme : 'file' , language : 'glsl' } ,
224212 { scheme : 'file' , language : 'wgsl' } ,
225213 ] ,
214+ outputChannel : channel ,
226215 middleware : getMiddleware ( ) ,
227216 errorHandler : new ShaderErrorHandler ( )
228217 } ;
229218
230219 let client = new LanguageClient (
231220 'shader-validator' ,
232- 'Shader language server' ,
221+ channelName ,
233222 serverOptions ,
234223 clientOptions ,
235224 context . extensionMode === vscode . ExtensionMode . Development
@@ -238,9 +227,6 @@ async function createLanguageClientStandard(context: vscode.ExtensionContext, pl
238227 // Start the client. This will also launch the server
239228 await client . start ( ) ;
240229
241- // Ensure configuration is sent
242- notifyConfigurationChange ( context , client ) ;
243-
244230 return client ;
245231}
246232async function createLanguageClientWASI ( context : vscode . ExtensionContext ) : Promise < LanguageClient > {
@@ -340,7 +326,6 @@ async function createLanguageClientWASI(context: vscode.ExtensionContext) : Prom
340326 } catch ( error ) {
341327 client . error ( `Start failed` , error , 'force' ) ;
342328 }
343- notifyConfigurationChange ( context , client ) ;
344329
345330 return client ;
346331}
0 commit comments