nextflow-io / language-server

The Nextflow language server
Apache License 2.0
9 stars 0 forks source link

Backslashes in modules create a double backslash every time formatting is ran #55

Closed edmundmiller closed 3 weeks ago

edmundmiller commented 3 weeks ago

When I run formatting on a module file every backslash gets a double backslash. \\ becomes \\\\ and then keeps going.

It also looks like \$ like in the echo statement of a version.yml output also removes the $ and doubles the .

bentsherman commented 3 weeks ago

The backslash issue is fixed on main. Can you give an example of the second issue?

edmundmiller commented 3 weeks ago

Awesome! Let me give it a test and see if that fixes the issue. Original:

    cat <<-END_VERSIONS > versions.yml
    "${task.process}":
        python: \$(python --version | sed 's/Python //g')
        pints: \$(pints_caller --version)
    END_VERSIONS

First pass:

    cat <<-END_VERSIONS > versions.yml
    "${task.process}":
        python: \\$(python --version | sed 's/Python //g')
        pints: \\$(pints_caller --version)
    END_VERSIONS

Second Pass:

    cat <<-END_VERSIONS > versions.yml
    "${task.process}":
        python: \\\\python --version | sed 's/Python //g')
        pints: \\\\pints_caller --version)
    END_VERSIONS

https://github.com/nf-core/nascent/blob/3b9060ea14057327fe0245562c3e3ef9025771cd/modules/nf-core/pints/caller/main.nf

edmundmiller commented 3 weeks ago

Just tested out main, that fixed it! Thanks!