aws / aws-toolkit-jetbrains

AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
Apache License 2.0
752 stars 216 forks source link

AWS Toolkit disables full line code completion in PyCharm Professional #4076

Open Syrus-at-Philips opened 9 months ago

Syrus-at-Philips commented 9 months ago

Describe the bug The latest version of AWS Toolkit disables full line code completion due to Amazon Q and Codewhisperer integration, but those are optional features, and even if they are not enabled, the bundled AI code completion is automatically disabled.

To reproduce Install the latest version of AWS Toolkit but do not enable Amazon Q or Codewhisperer. Then try to enable full line suggestions in Editor->General->Code Completion. You will see a message that it cannot be enabled due to the AWS Toolkit despite the fact that Q and Codewhisperer are not active.

Expected behavior If I don't use Amazon Q or Codewhisperer, I should not lose the ability to use the bundled AI code completion. I should be able to use the AWS Toolkit SSO management and Exporer without Q and Codewhisperer. Why are those part of the same extension? And why can't we disable those features to keep the bundled features?

Screenshots image

Your Environment

thecodemonk commented 9 months ago

This happens in Rider as well.

el-veee commented 9 months ago

Also happening for Webstorm 2023.3.2

kkarnauk commented 8 months ago

Hello! For a long time, IntelliJ Platform lacked a built-in API to display inline completion (aka gray text completion). As a result, many plugins, including AWS Codewhisperer, implemented it from scratch. In the latest 2023.3 release, the IntelliJ platform added an API for inline completion, which is precisely utilized in Full Line Code Completion.

The new built-in API is not compatible with implementations of other plugins, potentially causing two independent gray texts within the editor. The decision was made on the Full Line side to disable it if a known plugin with a similar UX is present. The solution to the problem is for AWS Codewhisperer to transition to the new API. We hope for their collaboration.

If the Codewhisperer team decides to migrate to the new API, you can find the entry points below:

Thank you in advance!

Syrus-at-Philips commented 8 months ago

Hello! For a long time, IntelliJ Platform lacked a built-in API to display inline completion (aka gray text completion). As a result, many plugins, including AWS Codewhisperer, implemented it from scratch. In the latest 2023.3 release, the IntelliJ platform added an API for inline completion, which is precisely utilized in Full Line Code Completion.

The new built-in API is not compatible with implementations of other plugins, potentially causing two independent gray texts within the editor. The decision was made on the Full Line side to disable it if a known plugin with a similar UX is present. The solution to the problem is for AWS Codewhisperer to transition to the new API. We hope for their collaboration.

If the Codewhisperer team decides to migrate to the new API, you can find the entry points below:

  • The API is located in the package com.intellij.codeInsight.inline.completion.
  • The InlineCompletionProvider is the main class responsible for providing inline completion suggestions. It responds to various events, and for each one, it indicates whether it is ready to provide any suggestions for that event. There are default events: typing, changes in lookup, and direct call. If you require more events, you can create your own. There is a version of the provider that uses delayed execution to avoid wasting resources on non-meaningful user inputs.
  • For lower-level interaction, there's the InlineCompletionHandler. You can attach your listeners to it in order to monitor what happens with the suggestions generated. Furthermore, you can send your custom events via InlineCompletionHandler.
  • The provider yields a flow of InlineCompletionElements that need to be rendered. Because the flow is lazy, this API supports data streaming, allowing for the gradual appearance of elements. Each element features an interface that demonstrates how to render it. The standard rendering of gray text is already provided. Should you require more complex elements, you can easily achieve this by extending the interface as described above.
  • The API also supports reaction to overtyping, meaning instances where the user types characters that match the suggestion. Additionally, you can add a custom insertion handler if you need to perform specific actions following element insertion.
  • For now, support for only one suggestion per event is available out of the box. We plan to enable support for multiple suggestions in the upcoming 2024.1 release. However, you can also incorporate this functionality through custom events as detailed earlier. Here is an example of support for a “multiple suggestions” inline completion provider.

Thank you in advance!

You miss the point of this bug report. We want to disable CodeWhisperer without losing all of the original capabilities of the AWS toolkit. Because many of us cannot use CodeWhisperer for legal/regulatory reasons. The bug is that CodeWhisperer is not optional in this plugin.

Syrus-at-Philips commented 8 months ago

Consider this a duplicate of #4068.

justinmk3 commented 8 months ago

https://github.com/aws/aws-toolkit-jetbrains/issues/4068 is also something we want to address, but they aren't duplicates. Being able to use CodeWhisperer features without conflicting with other Intellij features is also needed.

mattjudge commented 7 months ago

Could Codewhisperer be released as a seperate plugin in the meantime, to avoid users having to make a hard decision between having all the other AWS toolkit features available, and having pycharm's full line completion working?

fhaubold commented 6 months ago

Same for IntelliJ IDEA 2024.1

KevinVR commented 5 months ago

Same issue on WebStorm, I'd like to keep using the Full line code completion from JetBrains if I don't have CodeWhisperer enabled.

emiliopedrollo commented 5 months ago

Some issue on PHPStorm. I'm disabling AWS toolkit for now so I can test drive full line completion.

Fossan commented 4 months ago

Seems this issue is finally resolved in 2024.1.2 version of the IDEs 🥳 image image