From dbffac8a551ca89436072b3e5a956be8cb71a4b6 Mon Sep 17 00:00:00 2001 From: Will Lo Date: Mon, 21 Oct 2024 04:06:02 -0700 Subject: [PATCH 1/3] setup project context ab for inline completion --- .../services/amazonq/CodeWhispererFeatureConfigService.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/CodeWhispererFeatureConfigService.kt b/plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/CodeWhispererFeatureConfigService.kt index 80cbbcf9f54..16e4989e892 100644 --- a/plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/CodeWhispererFeatureConfigService.kt +++ b/plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/CodeWhispererFeatureConfigService.kt @@ -108,6 +108,8 @@ class CodeWhispererFeatureConfigService { fun getNewAutoTriggerUX(): Boolean = getFeatureValueForKey(NEW_AUTO_TRIGGER_UX).stringValue() == "TREATMENT" + fun getInlineCompletion(): Boolean = getFeatureValueForKey(INLINE_COMPLETION).stringValue() == "TREATMENT" + // Get the feature value for the given key. // In case of a misconfiguration, it will return a default feature value of Boolean false. private fun getFeatureValueForKey(name: String): FeatureValue = @@ -117,6 +119,7 @@ class CodeWhispererFeatureConfigService { companion object { fun getInstance(): CodeWhispererFeatureConfigService = service() private const val TEST_FEATURE_NAME = "testFeature" + private const val INLINE_COMPLETION = "ProjectContextV2" private const val DATA_COLLECTION_FEATURE = "IDEProjectContextDataCollection" const val CUSTOMIZATION_ARN_OVERRIDE_NAME = "customizationArnOverride" private const val NEW_AUTO_TRIGGER_UX = "newAutoTriggerUX" @@ -141,6 +144,11 @@ class CodeWhispererFeatureConfigService { "CONTROL", FeatureValue.builder().stringValue("CONTROL").build() ), + INLINE_COMPLETION to FeatureContext( + INLINE_COMPLETION, + "CONTROL", + FeatureValue.builder().stringValue("CONTROL").build() + ) ) } } From c6ae82a66a52e7f03a1cf891b24bfa7a83557412 Mon Sep 17 00:00:00 2001 From: Will Lo Date: Mon, 21 Oct 2024 11:36:07 -0700 Subject: [PATCH 2/3] Empty-Commit From 6ed58a4b1873d964a1b55dc4c12911e45d4b62c0 Mon Sep 17 00:00:00 2001 From: Will Lo Date: Mon, 21 Oct 2024 13:26:16 -0700 Subject: [PATCH 3/3] suprress unused warning --- .../services/amazonq/CodeWhispererFeatureConfigService.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/CodeWhispererFeatureConfigService.kt b/plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/CodeWhispererFeatureConfigService.kt index 16e4989e892..5193d4e704f 100644 --- a/plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/CodeWhispererFeatureConfigService.kt +++ b/plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/CodeWhispererFeatureConfigService.kt @@ -108,6 +108,7 @@ class CodeWhispererFeatureConfigService { fun getNewAutoTriggerUX(): Boolean = getFeatureValueForKey(NEW_AUTO_TRIGGER_UX).stringValue() == "TREATMENT" + @Suppress("UNUSED") fun getInlineCompletion(): Boolean = getFeatureValueForKey(INLINE_COMPLETION).stringValue() == "TREATMENT" // Get the feature value for the given key.