If you want IDEA to recognize the Jenkinsfile as a Groovy file, you can add the String "Jenkinsfile" as a valid file name template (usually contains the end of the file) for Groovy files. This is supported out of the box, without requiring an additional plugin (except for the Groovy plugin, but this is already part of IDEA).
To do this, go to the settings menu, open the "Editor", and then "File Types". Now select "Groovy" in the top list and add "Jenkinsfile". You can also use a regular expression like "Jenkinsfile *" if you want to be more flexible about the optional file ending for a Jenkins file.
The setup should now look like this: 
Your example now looks like this in IDEA (with a Dracula theme): 
Thus, IDEA now provides syntax highlighting and automatic completion, as far as I can tell. It offers existing function / method names during recording, but I'm not a Groovy developer, so I can't tell if any suggestions are missing.
source share