Vscode extension "unexpected input: try"

I’m getting the error “unexpected input: ‘try’” for a line like this in my pipeline. This is not the identical set up, but my pipeline is based off this one. I couldn’t find any discussion of try-catch blocks being disallowed with the new vscode extension here.

Does anyone know what’s causing this error or how update the code to satisfy the linter?

They’re deprecated. See Remove try-catch blocks around institutional configs · Issue #3132 · nf-core/tools · GitHub for instance. It seems @bentsherman missed documenting this one too in the VS Code integration — Nextflow documentation

I think the solution is what’s suggested for the dynamic include: VS Code integration — Nextflow documentation

includeConfig ({
    def hostname = // ...
    if (hostname == 'small')
        return 'small.config'
    else if (hostname == 'large')
        return 'large.config'
    else
        return '/dev/null'
}())

thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.