@@ -12,10 +12,7 @@ import { Commands, getLogger, globals, undefinedIfEmpty } from 'aws-core-vscode/
12
12
import { activate as registerLegacyChatListeners } from '../../app/chat/activation'
13
13
import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq'
14
14
import { AuthUtil , getSelectedCustomization , notifyNewCustomizations } from 'aws-core-vscode/codewhisperer'
15
- import {
16
- DidChangeConfigurationNotification ,
17
- updateConfigurationRequestType ,
18
- } from '@aws/language-server-runtimes/protocol'
15
+ import { pushConfigUpdate } from '../config'
19
16
20
17
export async function activate ( languageClient : LanguageClient , encryptionKey : Buffer , mynahUIPath : string ) {
21
18
const disposables = globals . context . subscriptions
@@ -124,47 +121,3 @@ export async function activate(languageClient: LanguageClient, encryptionKey: Bu
124
121
} )
125
122
}
126
123
}
127
-
128
- /**
129
- * Request/Notify a config value to the language server, effectively updating it with the
130
- * latest configuration from the client.
131
- *
132
- * The issue is we need to push certain configs to different places, since there are
133
- * different handlers for specific configs. So this determines the correct place to
134
- * push the given config.
135
- *
136
- * TODO: Move this to somewhere more appropriate
137
- */
138
- async function pushConfigUpdate ( client : LanguageClient , config : QConfigs ) {
139
- switch ( config . type ) {
140
- case 'profile' :
141
- await client . sendRequest ( updateConfigurationRequestType . method , {
142
- section : 'aws.q' ,
143
- settings : { profileArn : config . profileArn } ,
144
- } )
145
- break
146
- case 'customization' :
147
- client . sendNotification ( DidChangeConfigurationNotification . type . method , {
148
- section : 'aws.q' ,
149
- settings : { customization : config . customization } ,
150
- } )
151
- break
152
- case 'logLevel' :
153
- client . sendNotification ( DidChangeConfigurationNotification . type . method , {
154
- section : 'aws.logLevel' ,
155
- } )
156
- break
157
- }
158
- }
159
- type ProfileConfig = {
160
- type : 'profile'
161
- profileArn : string | undefined
162
- }
163
- type CustomizationConfig = {
164
- type : 'customization'
165
- customization : string | undefined
166
- }
167
- type LogLevelConfig = {
168
- type : 'logLevel'
169
- }
170
- type QConfigs = ProfileConfig | CustomizationConfig | LogLevelConfig
0 commit comments