Skip to content

Commit 6065695

Browse files
authored
fix: add feature flag command to context (#13)
* fix: add feature flag command to context * fix: move into additional commands
1 parent da92741 commit 6065695

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import { ContextCommandItem } from '../../../amazonq/lsp/types'
6969
import { createPromptCommand, workspaceCommand } from '../../../amazonq/webview/ui/tabs/constants'
7070
import fs from '../../../shared/fs/fs'
7171
import * as vscode from 'vscode'
72+
import { FeatureConfigProvider, Features } from '../../../shared/featureConfig'
7273

7374
export interface ChatControllerMessagePublishers {
7475
readonly processPromptChatMessage: MessagePublisher<PromptMessage>
@@ -439,6 +440,17 @@ export class ChatController {
439440
],
440441
},
441442
]
443+
444+
const feature = FeatureConfigProvider.getFeature(Features.highlightCommand)
445+
const commandName = feature?.value.stringValue
446+
if (commandName) {
447+
const commandDescription = feature.variation
448+
contextCommand.push({
449+
groupName: 'Additional Commands',
450+
commands: [{ command: commandName, description: commandDescription }],
451+
})
452+
}
453+
442454
const lspClientReady = await LspClient.instance.waitUntilReady()
443455
if (!lspClientReady) {
444456
return

packages/core/src/shared/featureConfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const Features = {
4141
projectContextFeature: 'ProjectContextV2',
4242
workspaceContextFeature: 'WorkspaceContext',
4343
test: 'testFeature',
44+
highlightCommand: 'highlightCommand',
4445
} as const
4546

4647
export type FeatureName = (typeof Features)[keyof typeof Features]

0 commit comments

Comments
 (0)