Reputation: 665
When I create a build.gradle file and open it with IntelliJ, it does not recognize the build.gradle file and a lightbulb appears suggesting that I correct my gradle syntax. See the picture on top. I can still run the gradle file successfully in intellij.
However, when I create a Gradle Project using the New Project option in IntelliJ, I get proper syntax highlighting.
What should I do to get syntax highlighting for my build.gradle file?
Upvotes: 3
Views: 3798
Reputation: 16381
For an IDE to recognize build.gradle
files as a Gradle build script instead of simple plain Groovy file it needs to be opened(imported) as a Gradel build file. You can do it from the file's context menu:
Upvotes: 3