You can try using the IntelliJ IDEA GDSL file provided by Jenkins in your IDE.
Download the content from http://<JENKINS>/pipeline-syntax/gdsl
to a pipline.gdsl
file and add this file to your IntelliJ Jenkins Pipeline project's source folder.
(You may also want to add that file to your SCMs ignore-list.)
Autocompletion before and after adding GDSL file:
On the Jenkins UI you find that GDSL file in your pipeline project under "Pipeline Syntax > IntelliJ IDEA GDSL".
However, I found some caveats with this solution that required me to manually edit the pipeline.gdsl
file, but that could be related to my not up-to-date Jenkins installation (?):
- custom global variables (from the
/var
folder) are considered in the GDSL file, but methods defined on that variable are not.
- the
parallel
step was not exported properly due to an error(?) on the ParallelStep
class
(Source of knowledge: Veaceslav Gaidarji's blog.)
http://<JENKINS>/job/<PIPELINE_JOB>/pipeline-syntax/gdsl
. How did you find that link? Is there constraints to get it (jenkins version, need admin right, ...)? Does it cope with organization/project/subproject structure? – Machuca