@@ -8,14 +8,15 @@ import { LanguageClient } from 'vscode-languageclient'
88import { AmazonQChatViewProvider } from './webviewProvider'
99import { registerCommands } from './commands'
1010import { registerLanguageServerEventListener , registerMessageListeners } from './messages'
11- import { Commands , getLogger , globals , undefinedIfEmpty } from 'aws-core-vscode/shared'
11+ import { Commands , getLogger , globals , Settings , undefinedIfEmpty } from 'aws-core-vscode/shared'
1212import { activate as registerLegacyChatListeners } from '../../app/chat/activation'
1313import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq'
1414import { AuthUtil , getSelectedCustomization } from 'aws-core-vscode/codewhisperer'
1515import {
1616 DidChangeConfigurationNotification ,
1717 updateConfigurationRequestType ,
1818} from '@aws/language-server-runtimes/protocol'
19+ import { getLspLogSettings , lspSettingsSection } from '../config'
1920
2021export async function activate ( languageClient : LanguageClient , encryptionKey : Buffer , mynahUIPath : string ) {
2122 const disposables = globals . context . subscriptions
@@ -85,6 +86,10 @@ export async function activate(languageClient: LanguageClient, encryptionKey: Bu
8586 type : 'customization' ,
8687 customization : undefinedIfEmpty ( getSelectedCustomization ( ) . arn ) ,
8788 } )
89+ } ) ,
90+ Settings . instance . onDidChangeSection ( lspSettingsSection , ( ) => {
91+ void pushConfigUpdate ( languageClient , { type : 'logging' , ...getLspLogSettings ( ) } )
92+ getLogger ( ) . info ( 'LSP settings changed, sending to lsp' )
8893 } )
8994 )
9095}
@@ -108,6 +113,10 @@ async function pushConfigUpdate(client: LanguageClient, config: QConfigs) {
108113 section : 'aws.q' ,
109114 settings : { customization : config . customization } ,
110115 } )
116+ } else if ( config . type === 'logging' ) {
117+ client . sendNotification ( DidChangeConfigurationNotification . type . method , {
118+ section : 'aws.logLevel' ,
119+ } )
111120 }
112121}
113122type ProfileConfig = {
@@ -118,4 +127,8 @@ type CustomizationConfig = {
118127 type : 'customization'
119128 customization : string | undefined
120129}
121- type QConfigs = ProfileConfig | CustomizationConfig
130+ interface LoggingConfig extends ReturnType < typeof getLspLogSettings > {
131+ type : 'logging'
132+ }
133+
134+ type QConfigs = ProfileConfig | CustomizationConfig | LoggingConfig
0 commit comments