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

Wrong Syntax Highlighting on mid line # #150

Open
alexr00 opened this issue Jul 29, 2019 · 5 comments
Open

Wrong Syntax Highlighting on mid line # #150

alexr00 opened this issue Jul 29, 2019 · 5 comments

Comments

@alexr00
Copy link

alexr00 commented Jul 29, 2019

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.

@rsese
Copy link

rsese commented Jul 30, 2019

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.

@lkashef
Copy link

lkashef commented Dec 2, 2019

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

@alexr00
Copy link
Author

alexr00 commented Dec 2, 2019

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

@lkashef
Copy link

lkashef commented Dec 2, 2019

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

@lkashef
Copy link

lkashef commented Dec 3, 2019

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants