Alt-Enter auto import not working for Scala project

I'm working with a Scala/Java hybrid project. When typing in my Scala files, if I reference a type that needs to be imported, I get the popup telling me to press Alt+Enter to see a list of candidates for importing. I can see all the right candidates, but when I click on one or select it and press "Enter", nothing happens...I have to manually type out the import statement. This feature works as expected for Java files in the same project - I press Alt+Enter, choose the candidate from the list, and an import is automatically added at the top. Scala is the only language that is broken.

I am using IDEA version 2017.1.2 with Scala plugin 2017.1.15.

5
Avatar
Permanently deleted user

I'm having a similar problem with Kotlin/Android projects - alt-enter works about half the time. It seems to mostly not work for enum's and sealed classes that I try to add an import to (e.g. an enum "Operation.Add" trying to import it so it can just be "Add"). Intermittent issue but frustrating for sure.

1

I'm having the same problem. Recreating the project from scratch didn't solve.

0
Avatar
Permanently deleted user

Colleague has Community Edition 2017.1.5 installed and he is having same problem. I am using Enterprise Edition 2017.1.4 and do not have any issues with Alt-Enter imports.

0
Avatar
Permanently deleted user

So as soon as I posted this, Alt+Enter stopped working for me. Only in a specific project. Even after updating to IDEA EE 2017.1.5, re-importing my project, deleting the .idea folder... nothing works.

The prompt appears.. it knows which lib to import, but Alt+Enter does nothing. Very frustrating.

UPDATE: It appears that it only affects external imports, project-local imports work just fine.

0
Avatar
Permanently deleted user

Same issue for me with a Java project. Just upgraded to 2017.3.1. Alt-Enter does nothing. Running on macOS v10.12.6.

0

请先登录再写评论。