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.

Wrong Syntax Highlighting on mid line # #150

Open

Description

@alexr00

From @IceWreck in microsoft/vscode#78034

Steps to Reproduce:

  1. Open a bash script. (.sh file)
  2. Write some code and then type # in the same line. Example :
sudo dnf remove -y \
krdc \
kmail \
kgpg \
krusader \ # the old kde twinstyle file manager
kruler
  1. Everything after # is greyed out and vscode thinks that its a comment, misleading the user

This is wrong, as bash does not consider everything after # as a comment and running the script can lead to disastrous results as it would remove the file package, which is somehow a dependency for essential packages and removing it can break the system.

Activity

  1. rsese commented on Jul 30, 2019

    @rsese

    Thanks for the report 👍 I can reproduce on macOS 10.14 with 1.41.0-nightly3 using Tree-sitter. Please note however that we would only resolve the issue in the Tree-sitter grammar since we're generally no longer maintaining the first-mate grammar when there is a built-in Tree-sitter grammar available.

  2. self-assigned this
    on Dec 2, 2019
  3. lkashef commented on Dec 2, 2019

    @lkashef

    Hello @alexr00, thank you for the report.

    I am actually trying to reproduce this in atom 1.41.0 stable without success, could you confirm on your end if the issue still persist.

    Screen Shot 2019-12-02 at 10 24 21 AM

  4. alexr00 commented on Dec 2, 2019

    @alexr00
    Author

    @lkashef your screen shot is showing the same problem. The characters after the # are tokenized as a comment, when they should not be.

  5. lkashef commented on Dec 2, 2019

    @lkashef

    @alexr00 the inline comment is not allowed, I got what you mean. Thanks.

  6. lkashef commented on Dec 3, 2019

    @lkashef

    This issue seems to be originating from tree-sitter-bash, so I created an issue that will hopefully fix this issue and microsoft/vscode#78034.

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