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).

/*
* 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}
"""
}