Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

shell script wrong comment highlighting after '#' #111

Open

Description

@aeschli

Edit by @rsese to share Tree-sitter screenshot

tree-sitter-error


A comment is implied after the hash symbol.

Steps to Reproduce:

func="$(echo $i | gawk -F[#] '{printf ($1)}')"`

All after # symbol will be a "comment"

Copied from original issue: microsoft/vscode#45143

Activity

  1. changed the title [-]shell script wrong comment highlighting[/-] [+]shell script wrong comment highlighting after '#'[/+] on Mar 8, 2018
  2. elyscape commented on May 31, 2018

    @elyscape
    Contributor

    This appears to be an unintended result of 799f16e, which added support for comments inside of backtick and $() expressions.

  3. lmcarreiro commented on Feb 9, 2019

    @lmcarreiro

    I got another problem related to it:

    image

    objLineNumbers=`
        cat -n |    # the color of this single-line comment leaked to the next lines
        sed --expression="
            /^\s+[0-9]+\t-/ s|^\s+([0-9]+)\t.*|\1|p     # Lines that starts with '-'
        " --regexp-extended --quiet
    `
    
    objLineNumbers=`
        cat -n |
        sed --regexp-extended --quiet --expression="
            /^\s+[0-9]+\t-/ s|^\s+([0-9]+)\t.*|\1|p     # Lines that starts with '-'
        "
    `
  4. rsese commented on Feb 12, 2019

    @rsese

    Reproduced with 1.34.0 on macOS 10.12.6 with Tree-sitter, also looks like an error?

    tree-sitter-error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions