# Comments Within Process Removed

**URL:** <https://community.seqera.io/t/comments-within-process-removed/1414>\
**Category:** Ask for help\
**Tags:** vscode\
**Created:** [November 14, 2024, 12:06am UTC](https://community.seqera.io/t/comments-within-process-removed/1414 "2024-11-14T00:06:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sukh\_Sekhon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/sukh_sekhon/32/1236_2.png) [@Sukh\_Sekhon](https://community.seqera.io/u/Sukh_Sekhon)\
**Post date:** [November 14, 2024, 12:06am UTC](https://community.seqera.io/t/comments-within-process-removed/1414/1 "2024-11-14T00:06:47Z")

</div>

Hello,

I’m very excited about the formatting feature! However, I’ve noticed that any comments within “process” blocks are removed during formatting. Here’s an example:

```auto
process MY_PROCESS {
  /* 
  This block comment is removed.
  */
  label 'foo' // This line comment is also removed.
  ...
}

```

Is there a way to preserve comments within `process` blocks when formatting? Any help or guidance would be appreciated!

Thank you!

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [November 14, 2024, 1:09pm UTC](https://community.seqera.io/t/comments-within-process-removed/1414/2 "2024-11-14T13:09:24Z")

</div>

Hi @Sukh_Sekhon,

Welcome to the community forum. I just talked with the team and this accidental removal of comments within the process block has already been flagged and they’re working on that. Thanks for reporting it here.

If you want to make sure you’re made aware whne it’s fixed, please open an issue at [Issues · nextflow-io/vscode-language-nextflow · GitHub](https://github.com/nextflow-io/vscode-language-nextflow/issues).

---

<div class="post-metadata">

**Author:** ![jfy133](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/jfy133/32/60_2.png) [@jfy133](https://community.seqera.io/u/jfy133)\
**Post date:** [November 15, 2024, 12:29pm UTC](https://community.seqera.io/t/comments-within-process-removed/1414/3 "2024-11-15T12:29:27Z")

</div>

I also just (independently) reported this on the GitHub repo 🙂

> <https://github.com/nextflow-io/vscode-language-nextflow/issues/54>
>
> When formatting the file all comments get removed outside the script scope, and …the one comment within the script block at the end of the line gets placed below (identified by @Krannich479).
> 
> \- Is it expected that no comments are allowed in the rest of the process file? This seems overly strict.
> \- I think more naturally a comment should be moved \_above\_ the line it originally was on 
> 
> Given a process like this:
> 
> \`\`\`nextflow
> process MASON\_SIMULATOR {
> 
> // Job label
> // tag "${sample}"
> 
> // Store results
> publishDir "${params.outdir}", mode: 'copy', pattern: "\*.{NGSWGS.R1.fastq,NGSWGS.R2.fastq,bam}"
> 
> // Engine settings
> conda 'bioconda::mason=2.0.9'
> 
> // Resources
> cpus 2
> 
> // Process I/O
> input:
> tuple val(sample), path(vcf)
> val ref
> val ref\_idx
> 
> output:
> path "simulated\_hap${sample}.NGSWGS.{R1,R2}.fastq", emit: fastqs
> path "simulated\_hap${sample}.NGSWGS.bam", emit: bam
> 
> // Job script
> script:
> unique\_seed = (params.seed \* sample ) % 2147483647 // that's (2^31)-1, the upper bound for mason
> """
> mason\_simulator \\
> -ir ${ref} \\
> -iv ${vcf} \\
> -o simulated\_hap${sample}.NGSWGS.R1.fastq \\
> -or simulated\_hap${sample}.NGSWGS.R2.fastq \\
> -oa simulated\_hap${sample}.NGSWGS.bam \\
> --seed ${unique\_seed} \\
> --num-threads ${task.cpus} \\
> --num-fragments ${params.nb\_frag} \\
> --fragment-min-size ${params.fragment\_min\_size} \\
> --fragment-max-size ${params.fragment\_max\_size} \\
> --fragment-mean-size ${params.fragment\_mean\_size} \\
> --fragment-size-std-dev ${params.fragment\_size\_std\_dev} \\
> --illumina-read-length ${params.illumina\_read\_length} \\
> ${params.mason\_additional\_args}
> """
> 
> }
> \`\`\`
> 
> It gets formatted like:
> 
> \`\`\`nextflow
> process MASON\_SIMULATOR {
> publishDir "${params.outdir}", mode: 'copy', pattern: "\*.{NGSWGS.R1.fastq,NGSWGS.R2.fastq,bam}"
> conda 'bioconda::mason=2.0.9'
> cpus 2
> 
> input:
> tuple val(sample), path(vcf)
> val ref
> val ref\_idx
> 
> output:
> path "simulated\_hap${sample}.NGSWGS.{R1,R2}.fastq", emit: fastqs
> path "simulated\_hap${sample}.NGSWGS.bam", emit: bam
> 
> script:
> unique\_seed = (params.seed \* sample) % 2147483647
> // that's (2^31)-1, the upper bound for mason
> """
> mason\_simulator \\
> -ir ${ref} \\
> -iv ${vcf} \\
> -o simulated\_hap${sample}.NGSWGS.R1.fastq \\
> -or simulated\_hap${sample}.NGSWGS.R2.fastq \\
> -oa simulated\_hap${sample}.NGSWGS.bam \\
> --seed ${unique\_seed} \\
> --num-threads ${task.cpus} \\
> --num-fragments ${params.nb\_frag} \\
> --fragment-min-size ${params.fragment\_min\_size} \\
> --fragment-max-size ${params.fragment\_max\_size} \\
> --fragment-mean-size ${params.fragment\_mean\_size} \\
> --fragment-size-std-dev ${params.fragment\_size\_std\_dev} \\
> --illumina-read-length ${params.illumina\_read\_length} \\
> ${params.mason\_additional\_args}
> """
> }
> 
> \`\`\`

---

<div class="post-metadata">

**Author:** ![Sukh\_Sekhon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/sukh_sekhon/32/1236_2.png) [@Sukh\_Sekhon](https://community.seqera.io/u/Sukh_Sekhon)\
**Post date:** [November 15, 2024, 11:08pm UTC](https://community.seqera.io/t/comments-within-process-removed/1414/4 "2024-11-15T23:08:01Z")

</div>

Thank you both!! I’m very excited to start using the formatter! 😀

---

<div class="post-metadata">

**Author:** ![Sukh\_Sekhon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/sukh_sekhon/32/1236_2.png) [@Sukh\_Sekhon](https://community.seqera.io/u/Sukh_Sekhon)\
**Post date:** [December 2, 2024, 11:05pm UTC](https://community.seqera.io/t/comments-within-process-removed/1414/5 "2024-12-02T23:05:12Z")

</div>

Many thanks! The it works great with the latest version

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/system/32/2402_2.png) [@system](https://community.seqera.io/u/system)\
**Post date:** [December 9, 2024, 11:05pm UTC](https://community.seqera.io/t/comments-within-process-removed/1414/6 "2024-12-09T23:05:38Z")

</div>

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