-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: allow fixup and amend in subject #48
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,6 @@ | |
(breaking_change (value) @text) | ||
|
||
(scissor) @comment | ||
(subject_prefix) @keyword | ||
|
||
(ERROR) @error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node_type
subject_prefix
is undefined. nvim-treesitter/nvim-treesitter#5774 (comment).We'll also need:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an alias, you don't need any rule associated to the name (Ref: https://tree-sitter.github.io/tree-sitter/creating-parsers#the-grammar-dsl)
I'm not sure that it's the origin of your issue, have you updated your parser ?
:TSUpdate gitcommit
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are referring to anonymous nodes, the
name
part might need to be'subject_prefix'
not$.subject_prefix
. Seenvim-treesitter/nvim-treesitter#5774 (comment) --- I'm pretty sure the parser is up-to-date. Maybe it's fine on the treesitter side (because the test parse), but somehow nvim's treesitter parse does not recognize this rule (or node_type). There is clearly an error on the neovim's query parsing side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's definitely fine. For example,
https://github.com/tree-sitter/tree-sitter-c/blob/25371f9448b97c55b853a6ee8bb0bfb1bca6da9f/grammar.js#L161-L163
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at the generated parser.c, neither
ts_symbol_metadata
norts_symbol_names
, etc. containssym_subject_prefix
. I think the neovim's bundledlibtree-sitter
(I tested with 0.9.4 and 0.10-devel on macOS) is implemented in such a way that if that is not recognized as a valid node type, aTSQueryErrorNodeType
error will be thrown. Maybe we have a different tree-sitter lib/version linked. Anyway, the generated parser's node definition doesn't look correct to me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a tree-sitter-grammars/tree-sitter-markdown@110b89d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant, it's fine to use
$.unary_expression
but the difference here is that there exist rules for all these three node types. https://github.com/tree-sitter/tree-sitter-c/blob/25371f9448b97c55b853a6ee8bb0bfb1bca6da9f/grammar.js#L929.$.subject_prefix
(gitcommit) does not.And I didn't re-generate
parser.c
, the one that was built in commit 7e3ad5f was used so I'm not sure if this is x86 vs arm64 issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for investigations @wookayin but I'm retty sure that's it's not a grammar issue.
@lucario387 I'm building on x86 but I've switched to node 20 and node-gyp 10, maybe I should retry using node 18 and node-gyp 9 ?
Thanks for your help :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, I got the same generated parser.c as you, running on x86 :)
@amaanq will need to jump in to help here I feel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to build using docker, node 18, node 20, node-gyp 9, node-gyp 10, python 3.11, python 3.12 but I still get the same parser.c...
I've created an issue here if you prefer : #51