- 
                Notifications
    
You must be signed in to change notification settings  - Fork 273
 
feat(amazonq): add q config to lsp/configuration #5520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
b0c1cdf
              ba3cb74
              50e2f3d
              bb57f74
              d9ee16c
              5af7915
              8eafb45
              f069bd3
              47821ca
              36e79f9
              a5599a7
              0afdf3e
              9e36f65
              ad65042
              38d4084
              564d74b
              ce128ab
              fade5db
              78ac285
              085c9b0
              39e0c06
              00ef3a0
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| 
     | 
||
| package software.aws.toolkits.jetbrains.services.amazonq.lsp | ||
| 
     | 
||
| import com.google.gson.annotations.SerializedName | ||
| 
     | 
||
| data class AmazonQLspConfiguration( | ||
| @SerializedName(AmazonQLspConstants.LSP_OPT_OUT_TELEMETRY_CONFIGURATION_KEY) | ||
| val optOutTelemetry: Boolean? = null, | ||
| 
     | 
||
| @SerializedName(AmazonQLspConstants.LSP_ENABLE_TELEMETRY_EVENTS_CONFIGURATION_KEY) | ||
| val enableTelemetryEvents: Boolean? = null, | ||
| 
     | 
||
| @SerializedName(AmazonQLspConstants.LSP_CUSTOMIZATION_CONFIGURATION_KEY) | ||
| val customization: String? = null, | ||
| 
     | 
||
| val enableLocalIndexing: Boolean? = null, | ||
| 
     | 
||
| val enableGpuAcceleration: Boolean? = null, | ||
| 
     | 
||
| val indexWorkerThreads: Int? = null, | ||
| 
     | 
||
| val localIndexing: LocalIndexingConfiguration? = null, | ||
| ) | ||
| 
     | 
||
| data class LocalIndexingConfiguration( | ||
| val ignoreFilePatterns: List<String>? = null, | ||
| val maxFileSizeMB: Int? = null, | ||
| val maxIndexSizeMB: Int? = null, | ||
| val indexCacheDirPath: String? = null, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| 
     | 
||
| package software.aws.toolkits.jetbrains.services.codewhisperer.util | ||
| 
     | 
||
| import software.amazon.awssdk.services.codewhispererruntime.model.AccessDeniedException | ||
| import software.amazon.awssdk.services.codewhispererruntime.model.CodeWhispererRuntimeException | ||
| 
     | 
||
| object CustomizationConstants { | ||
| private const val noAccessToCustomizationMessage = "Your account is not authorized to use CodeWhisperer Enterprise." | ||
| 
         Check notice on line 10 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CustomizationConstants.kt 
    
   | 
||
        Check noticeCode scanning / QDJVMC Const property naming convention Note 
      Const property name noAccessToCustomizationMessage should not contain lowercase letters
     
 | 
||
| private const val invalidCustomizationMessage = "You are not authorized to access" | ||
| 
         Check notice on line 11 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CustomizationConstants.kt 
    
   | 
||
        Check noticeCode scanning / QDJVMC Const property naming convention Note 
      Const property name invalidCustomizationMessage should not contain lowercase letters
     
 | 
||
| 
     | 
||
| val noAccessToCustomizationExceptionPredicate: (e: Exception) -> Boolean = { e -> | ||
| if (e !is CodeWhispererRuntimeException) { | ||
| false | ||
| } else { | ||
| e is software.amazon.awssdk.services.codewhispererruntime.model.AccessDeniedException && (e.message?.contains(noAccessToCustomizationMessage, ignoreCase = true) ?: false) | ||
                
       | 
||
| } | ||
| } | ||
| 
     | 
||
| val invalidCustomizationExceptionPredicate: (e: Exception) -> Boolean = { e -> | ||
| if (e !is CodeWhispererRuntimeException) { | ||
| false | ||
| } else { | ||
| e is AccessDeniedException && (e.message?.contains(invalidCustomizationMessage, ignoreCase = true) ?: false) | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flag enableTelemetryEventsToDestination is set to true temporarily. It's value will be determined through destination configuration post all events migration to STE. It'll be replaced by qConfig['enableTelemetryEventsToDestination'] === trueThis is not currently being used but will be in future migrations. not exactly sure what it should be pointing to in current codebase