I keep trying to use methods on bits of data in nextflow closures, but am getting frustrated with simply guessing which methods can apply to which types of variable. Where can I look up the documentation that details all the methods of the UnixPath type, for example?
Example of my issue, for context, where I’m just trying to see how some variables look while working on a sort operation:
(nextflow) mbeavitt@home-pc:~/Code/Nextflow/samplevalidationbenchmark/temp/test$ ./sort.nf
N E X T F L O W ~ version 24.10.5
Launching `./sort.nf` [sleepy_shaw] DSL2 - revision: 6d58181426
ERROR ~ Unknown method invocation `split` on UnixPath type
-- Check script 'sort.nf' at line: 6 or see '.nextflow.log' file for more details
Correct. Rather than using methods for a particular class, I’d encourage you to use those defined in the java.nio.file.Path interface. These methods will be available for all of the different types, be it S3, GCP, local, etc.
We also expanded our standard library docs to include basic types like Path:
It’s a bit more informative than the Java Path interface, because there are also extension methods from Groovy and Nextflow, and many methods in the Java docs you would probably never use. Hope it helps.
Also working on some better auto-complete and hover hints in the language server for the 25.04 release. Hopefully should make it even easier to see the available methods, it basically brings these stdlib docs right into your editor.