Skip to content
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

Update Bass grammar and queries #6547

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

vito
Copy link
Contributor

@vito vito commented Apr 1, 2023

Hiya, this is a follow-up to #3771 that bumps to the latest grammar (now rewritten by @amaanq 🙏), updates the highlight rules, and adds a few more queries:

  • folds.scm
  • indents.scm
  • injections.scm
  • locals.scm

Tested locally on my machine and all seems well.

@vito vito changed the title update bass grammar and queries Update Bass grammar and queries Apr 1, 2023
@vito vito marked this pull request as draft April 2, 2023 04:28
@vito
Copy link
Contributor Author

vito commented Apr 2, 2023

Marking as draft; noticed a minor thing to fix in the grammar (expanding allowed characters in paths), will reopen when it's ready.

@vito vito marked this pull request as ready for review April 20, 2023 16:33
@vito
Copy link
Contributor Author

vito commented Apr 20, 2023

Path parsing fix is in, good to go now 👍

(path) @string.special.path
(command) @string.special.path

(number) @constant.numeric.integer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does number capture integers and floats? @constant.numeric would be more appropriate if it is both but the current capture is good if it's just integers


;; Comments

(comment) @comment.line @spell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(comment) @comment.line @spell
(comment) @comment


[
"^"
] @character.special
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
] @character.special
] @string.special

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like these are in the neovim format. We use different captures for indentation queries: https://docs.helix-editor.com/master/guides/indent.html

@@ -0,0 +1 @@
(comment) @comment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar here about injections

Suggested change
(comment) @comment
((comment) @injection.content
(#set! injection.language "comment"))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We follow tree-sitter for locals captures but these are in nvim's format. See https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables

@scope should become @local.scope while @reference becomes @local.reference and the two @definition... captures become @local.definition

@pascalkuthe pascalkuthe added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-language-support Area: Support for programming/text languages labels May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants