Skip to content

Add vscode-client highlighting based on tree-sitter-bash #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue Jul 29, 2021 · 4 comments
Open

Add vscode-client highlighting based on tree-sitter-bash #303

ghost opened this issue Jul 29, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Jul 29, 2021

I'd appreciate if something like git branch --delete patch-1 was highlighted appropriately in VSC. The --delete token would be highlighted as a parameter. The git token would be highlighted as a function.

Sample file: https://raw.githubusercontent.com/xtnm/AU-AD/80e8ac1/AE-go_GameServer/check_xml.sh

@ghost
Copy link
Author

ghost commented Jul 30, 2021

There seems to be some strange bug in the VSC extension itself that's preventing this highlight.

I'll open an issue at their repository instead.

@ghost ghost closed this as completed Jul 30, 2021
@ghost ghost reopened this Jul 31, 2021
@ghost
Copy link
Author

ghost commented Jul 31, 2021

It's out of VSC's scope. The problem is that this extension doesn't contribute any highlighting.

@mads-hartmann @skovhus could this extension contribute the highlighting tokens defined in:

https://github.com/atom/language-shellscript/blob/685a8b1/grammars/tree-sitter-bash.cson#L75-L144

@ghost ghost changed the title OS commands/functions integration Add vscode-client highlighting based on tree-sitter-bash Jul 31, 2021
@ghost
Copy link
Author

ghost commented Jul 31, 2021

The scopes that are highlighted exclusively by tree-sitter-bash:

scopes:
  'string > command_substitution': 'embedded.source'
  'command_name': 'entity.name.function'
  'file_descriptor': 'constant.numeric'
  'test_operator': 'entity.other.attribute-name'
  'word': [{match: '^-', scopes: 'entity.other.attribute-name'}]
  'special_variable_name': 'variable.other.member'
  'variable_name': 'variable.other.member'

@mads-hartmann
Copy link
Collaborator

@sndst00m I believe that we'd need to implement semantic highlighting (see guide) to achieve what you want. I can't personally dedicate the time to implement this at the moment but I'm happy to review PRs ☺️

@skovhus skovhus added the enhancement New feature or request label Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants