When the lib directory is a symlink, the language server will report groovy classes defined in lib as not defined.
To reproduce take any pipeline that uses lib/, more it somewhere else and link to it.
Not sure if this is a bug, but it is somewhat inconvenient. Symlinks are an easy way to reuse code that isn't ready to be a plugin yet.
NXF_SYNTAX_PARSER=v2 nextflow run does work when lib is a link.