-
Notifications
You must be signed in to change notification settings - Fork 263
feat(amazonq): inline completion JB API migration #5851
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
Conversation
Refactor CodeWhisperer inline completion implementation to use JetBrains' native inline completion provider instead of custom popup-based system. Key changes: - Replace custom action handlers with QInlineCompletionProvider - Remove deprecated popup navigation and acceptance actions - Consolidate authentication logic for Amazon Q connections - Migrate from CodeWhispererConnection to QConnection - Remove custom action promoter for inline completion - Streamline auto-trigger handling and invocation status This change improves IDE integration and provides a more native completion experience for users.
1e87cbc
to
bf0dbe4
Compare
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.
QDJVMC found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
/retryBuilds |
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.
Pull Request Overview
Refactor inline completion from CodeWhisperer’s custom popup to JetBrains’ native API and migrate all CodeWhisperer-specific connection code to use QConnection.
- Remove all references to CodeWhispererConnection and simplify connection checks to QConnection.
- Introduce
QInlineCompletionProvider
as the native inline completion provider along with UI components and telemetry integration. - Update telemetry viewer with a filter/search bar and deprecate popup-based action suites (tests are now ignored pending a rewrite).
Reviewed Changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
QMigrationActivity.kt | Simplified migration logic; removed CodeWhisperer check |
OpenTelemetryAction.kt | Added search/filter bar for telemetry viewer UI |
CodeWhispererPopupComponents.kt | Switched navigation buttons to hard-coded arrows |
Comments suppressed due to low confidence (1)
plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/startup/QMigrationActivity.kt:53
- By removing the CodeWhispererConnection check, existing CodeWhisperer users will no longer trigger the Q plugin migration. Consider restoring a check for legacy CodeWhisperer usage to ensure those users are also prompted to install/migrate.
if (hasUsedQ) {
filterField.document.addDocumentListener(object : DocumentAdapter() { | ||
override fun textChanged(e: DocumentEvent) { | ||
// Filter console content based on filterField.text | ||
applyFilter(filterField.text) | ||
} | ||
}) |
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 DocumentAdapter
listener is added but never removed, which can lead to memory leaks when the panel is disposed. Consider registering the listener with the panel’s Disposer
or explicitly removing it when the toolbar is torn down.
filterField.document.addDocumentListener(object : DocumentAdapter() { | |
override fun textChanged(e: DocumentEvent) { | |
// Filter console content based on filterField.text | |
applyFilter(filterField.text) | |
} | |
}) | |
val filterListener = object : DocumentAdapter() { | |
override fun textChanged(e: DocumentEvent) { | |
// Filter console content based on filterField.text | |
applyFilter(filterField.text) | |
} | |
} | |
filterField.document.addDocumentListener(filterListener) | |
Disposer.register(this) { | |
filterField.document.removeDocumentListener(filterListener) | |
} |
Copilot uses AI. Check for mistakes.
@@ -44,7 +44,7 @@ import javax.swing.JLabel | |||
import javax.swing.JPanel | |||
|
|||
class CodeWhispererPopupComponents { | |||
val prevButton = createNavigationButton(prevButtonText()) | |||
val prevButton = createNavigationButton("←") |
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.
[nitpick] Hard-coding arrow characters can hamper localization and screen-reader support. Consider using an icon or a localized resource string for the button text to improve accessibility.
Copilot uses AI. Check for mistakes.
There are many classes yet to be removed, e.g. most of the CodeWhispererService, CodeWhispererPopupManager, etc.
Will remove in future PRs.
Types of changes
Description
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.