# Nextflow Extension Code Formatting breaking my code?

**URL:** <https://community.seqera.io/t/nextflow-extension-code-formatting-breaking-my-code/1366>\
**Category:** Ask for help\
**Tags:** vscode\
**Created:** [November 4, 2024, 10:11am UTC](https://community.seqera.io/t/nextflow-extension-code-formatting-breaking-my-code/1366 "2024-11-04T10:11:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpampuch](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mpampuch/32/729_2.png) [@mpampuch](https://community.seqera.io/u/mpampuch)\
**Post date:** [November 4, 2024, 10:11am UTC](https://community.seqera.io/t/nextflow-extension-code-formatting-breaking-my-code/1366/1 "2024-11-04T10:11:51Z")

</div>

After updating the nextflow extension, I think some of the automatic formatting may be breaking my code.

Here is a snippet of code before formatting with the new formatter:

 ![screenshot_2024-11-04_at_10.28.10___am_720](https://europe1.discourse-cdn.com/flex013/uploads/seqera/original/2X/c/ce2215fd02d4bc4371b132c5ff9553a7f8b0ddd7.png)

After hitting Format, this is what I get (notice the extra `=` mark added)

 ![screenshot_2024-11-04_at_10.28.33___am_720](https://europe1.discourse-cdn.com/flex013/uploads/seqera/original/2X/f/fc8e1983dbc65498dee2f4ce1add902bfd1b5432.png)

Upon inspection I’m now getting an error that this `if` statement is incorrect

 ![screenshot_2024-11-04_at_10.28.51___am_720](https://europe1.discourse-cdn.com/flex013/uploads/seqera/original/2X/b/b4b3baa1feafac859d5a6eb1a674b84c665b6c90.png)

And now upon running this nextflow pipeline I get a compilation error.

```auto
N E X T F L O W ~ version 24.04.4

Launching `main.nf` [small_turing] DSL2 - revision: 45f0636c99

ERROR ~ Module compilation error
- file : /ibex/user/pampum/2024-10-28_test-modifying-sanger-tol-readmapping-pipeline-to-add-depth-calculations/readmapping_fork_with-samtools-depth/./workflows/../subworkflows/local/convert_stats.nf
- cause: Unexpected input: '{' @ line 16, column 24.
   workflow CONVERT_STATS {
                          ^

1 error

NOTE: If this is the beginning of a process or workflow, there may be a syntax error in the body, such as a missing or extra comma, for which a more specific error message could not be produced.

 -- Check script './workflows/readmapping.nf' at line: 26 or see '.nextflow.log' file for more details

```

And it ran perfectly fine before I formatted this document. Does anyone know if there are some bugs with the formatter currently?

---

<div class="post-metadata">

**Author:** ![bentsherman](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/bentsherman/32/52_2.png) [@bentsherman](https://community.seqera.io/u/bentsherman)\
**Post date:** [November 4, 2024, 10:16am UTC](https://community.seqera.io/t/nextflow-extension-code-formatting-breaking-my-code/1366/2 "2024-11-04T10:16:28Z")

</div>

Hi Mark, thanks for reporting. Looks like a bug in the formatter, I didn’t account for declarations with no initial value. This will be fixed in the next patch release.
