Android Studio Editor IntelliJ Intention / Context Actions (Alt+Enter) not functioning
See original GitHub issueSuspected error in Flutter Plugin version 47.1.2 (My Windows 10 system). Flutter Plugin version 46.0.2 works correctly (My Linux system).
If the cursor caret is placed at or inside a widget name, there is no yellow intention bulb, and Alt+Enter does not bring up the list of suggestions as stated here: https://www.jetbrains.com/help/idea/intention-actions.html
Right-clicking the widget name allows you to select Show Context Actions from the context menu, but then a message is shown “No context actions available at this location”.
Right clicking on the widget in the Flutter Outline does bring up a context menu allowing to wrap with certain widgets (though there is no option to “Wrap with widget”).
The red bulb does appear if there are errors on the line.
The yellow bulb does not appear when the cursor caret is within a widget name. The yellow bulb does appear when the cursor caret is placed after the last “),” in a descending tree. It also appears if the cursor is inside a text comment, and sometimes after the comma at the end of a parameter line, for example in the default project:
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
The yellow bulb appears when the cursor is at the end of the onPressed: and tooltip: lines only. The only context action is to Flip.
File menu -> Settings:
========================================================================= System: Windows 10 The context actions do not work. flutter doctor -v [√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.295], locale en-GB) • Flutter version 1.17.5 at E:\Flutter • Framework revision 8af6b2f038 (3 days ago), 2020-06-30 12:53:55 -0700 • Engine revision ee76268252 • Dart version 2.8.4
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0) • Android SDK at D:\Users\John\AppData\Local\Android\sdk • Platform android-30, build-tools 30.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted.
[√] Android Studio (version 4.0) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 47.1.2 • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.46.1) • VS Code at D:\Users\John\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.12.0
[!] Connected device ! No devices available
! Doctor found issues in 1 category.
========================================================================= System: Linux Mint The context actions work correctly. flutter doctor -v [✓] Flutter (Channel stable, v1.17.3, on Linux, locale en_GB.UTF-8) • Flutter version 1.17.3 at /home/john/Programs/flutter • Framework revision b041144f83 (4 weeks ago), 2020-06-04 09:26:11 -0700 • Engine revision ee76268252 • Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0) • Android SDK at /home/john/Android/Sdk • Platform android-30, build-tools 30.0.0 • Java binary at: /home/john/Programs/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.
[✓] Android Studio (version 4.0) • Android Studio at /home/john/Programs/android-studio • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[!] Connected device ! No devices available
! Doctor found issues in 1 category.
Context Actions work correctly in Linux with Flutter Plugin version 46.0.2
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Top GitHub Comments
I think problem solved by me. You wants this like picture using shortcut with Alt+Enter shown the Show Context Actions. Firstly you must install a plugin for Show Context Actions. You can follow that steps: Open -> SDK manager -> left menu Plugins -> when on Marketplace search " Flutter Snippets" after that install plugin restart IDE. Your problem solved. Secondly your option; If you wants change shortcuts you can follow steps: Android Studio File --> Settings --> Keymap --> Search this keyword “Show Context Actions” Right click Add Keyword Shortcut in area you can make the choice you want shortcuts. For example I want to chosee Ctrl+Space:
I hope help for you
If you are using MacOS try closing Android Studio and making sure that it is not running in the background, then reopen it again, worked for me.