@@ -16,6 +16,7 @@ import {
16
16
SDKInitializator ,
17
17
ResponseError ,
18
18
LSPErrorCodes ,
19
+ DidChangeConfigurationParams ,
19
20
} from '@aws/language-server-runtimes/server-interface'
20
21
import { AWSError } from 'aws-sdk'
21
22
import { autoTrigger , triggerType } from './auto-trigger/autoTrigger'
@@ -34,7 +35,7 @@ import { CodePercentageTracker } from './telemetry/codePercentage'
34
35
import { CodeWhispererPerceivedLatencyEvent , CodeWhispererServiceInvocationEvent } from './telemetry/types'
35
36
import { getCompletionType , getEndPositionForAcceptedSuggestion , isAwsError , safeGet } from './utils'
36
37
import { getUserAgent , makeUserContextObject } from './utilities/telemetryUtils'
37
- import { Q_CONFIGURATION_SECTION } from './configuration/qConfigurationServer'
38
+ import { Q_CONFIGURATION_SECTION , Q_CONFIGURATION_VSC } from './configuration/qConfigurationServer'
38
39
import { fetchSupplementalContext } from './utilities/supplementalContextUtil/supplementalContextUtil'
39
40
import { textUtils } from '@aws/lsp-core'
40
41
import { TelemetryService } from './telemetryService'
@@ -642,12 +643,13 @@ export const CodewhispererServerFactory =
642
643
await emitUserTriggerDecisionTelemetry ( telemetry , telemetryService , session , timeSinceLastUserModification )
643
644
}
644
645
645
- const updateConfiguration = async ( ) => {
646
+ const updateConfiguration = async ( params ?: DidChangeConfigurationParams ) => {
646
647
try {
647
648
// Currently can't hook AmazonQTokenServiceManager.handleDidChangeConfiguration to lsp listenre directly
648
649
// as it will override listeners from each consuming Server.
649
650
// TODO: refactor configuration listener in Server and AmazonQTokenServiceManager in runtimes.
650
- await amazonQServiceManager . handleDidChangeConfiguration ( )
651
+ const ideCategory = telemetryService . getUserContext ( ) ?. ideCategory
652
+ await amazonQServiceManager . handleDidChangeConfiguration ( ideCategory , params )
651
653
652
654
const qConfig = await lsp . workspace . getConfiguration ( Q_CONFIGURATION_SECTION )
653
655
if ( qConfig ) {
@@ -739,7 +741,7 @@ export const CodewhispererServerFactory =
739
741
lsp . extensions . onInlineCompletionWithReferences ( onInlineCompletionHandler )
740
742
lsp . extensions . onLogInlineCompletionSessionResults ( onLogInlineCompletionSessionResultsHandler )
741
743
lsp . onInitialized ( onInitializedHandler )
742
- lsp . didChangeConfiguration ( updateConfiguration )
744
+ lsp . didChangeConfiguration ( params => updateConfiguration ( params ) )
743
745
744
746
lsp . onDidChangeTextDocument ( async p => {
745
747
const textDocument = await workspace . getTextDocument ( p . textDocument . uri )
0 commit comments