I'm in the process of developing a shared library for Jenkins with scripts in vars/
and classes in src/
.
I have these two stumbling blocks:
I use a Jenkins-specific method
sh
orecho
. It is greyed out because Eclipse doesn't recognize it as a proper Groovy method. Is there a way to make these "known" to Eclipse?I create a file
vars/foo.groovy
with two methods,call()
andhelper()
. Usingfoo()
anywhere int he program results in it being greyed out, suggesting that Eclipse doesn't know what this refers to. Is there a way to make Eclipse understand thatfoo()
is now a legal method?
Note that insidefoo.groovy
, bothcall()
andhelper()
are recognized as valid methods. The same holds true for a classsrc/clazz.groovy
- usingnew clazz()
gets recognized everywhere in the shared library as valid code and the shown doc refers to theclazz.groovy
file.
All of this works fine if run on Jenkins, this is purely about syntax highlighting and, if possible, showing the Javadoc when hovering over the functions. Syntax highlighting is the main concern, though, as it is a PITA to deploy a shared library only to notice there's a typo in some function somewhere I didn't catch because it's all greyed out.
The default Groovy syntax highlighting works, this is just about methods relating directly to Jenkins and/or the shared library.
This doesn't help me as it refers to IntelliJ which is sadly not an option.