4

I have Jenkinsfile it's written in Groovy, but file name doesn't have approprite extension: .groovy. How can I tell IDEA to check groovy syntax of this file?

Update: Also I interested in the same question about GoLand IDE

Mureinik
  • 297,002
  • 52
  • 306
  • 350
Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192

2 Answers2

4

From the project sidebar, right-click the file and choose "Associate with File Type". Then just select Groovy from the menu, and you're all set.

enter image description here

GoLand does not support Groovy so this will not be possible there.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
3

If you add following header comment in the beginning of your Jenkinsfile:

#!groovy

IntelliJ IDEA will automatically recognize this file as a Groovy source file. It should work for other editors and IDEs as well.

Szymon Stepniak
  • 40,216
  • 10
  • 104
  • 131