Skip to content

Closure with ternary in process settings causes syntax highlighting to be lost #3

@awgymer

Description

@awgymer

When implementing a conditional errorStrategy as suggested here I have found that having a ternary expression inside a closure for process settings causes the syntax highlighting to be lost. A small example can be seen in this screenshot (text included for ease of reproducing).

Screenshot 2021-09-07 at 14 03 34

/* 
 * Enable DSL 2 syntax
 */
nextflow.enable.dsl = 2


process PROC1 {
    cache true
    memory { 2.GB * task.attempt }
    errorStrategy { task.attempt <= 3 ? 'retry':'ignore' }
    maxRetries 3

    input: 
    path fasta
 
    output: 
    path "${fasta}.fai"
  
    script:
    """
    samtools faidx ${fasta}
    """
}


process PROC2 {
    cache true
    memory { 2.GB * task.attempt }
    maxRetries 3

    input: 
    path fasta
 
    output: 
    path "${fasta}.fai"
  
    script:
    """
    samtools faidx ${fasta}
    """
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions