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

Add support for annotations with grammar #165

Merged
merged 7 commits into from
Jun 25, 2024

Conversation

mkatychev
Copy link
Contributor

@mkatychev mkatychev commented Jun 24, 2024

Recent additions to just added [annotations("with-arguments")]:

[group("foo"), group("echo")]
foo:
  echo "foo"

[doc("this is bar")]
bar:
  echo "bar"

https://just.systems/man/en/chapter_35.html
https://just.systems/man/en/chapter_28.html

Fixes #164

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these files were created as part of just gen:

$ tree-sitter --version
tree-sitter 0.22.6

@mkatychev
Copy link
Contributor Author

Getting some issues with npx tree-sitter:

$ just test-parse-highlight
+ '[' '!' -d ~/Documents/tree-sitter/just/repositories/just ']'
++ git -C ~/Documents/tree-sitter/just/repositories/just rev-parse HEAD
+ actual_sha=5f91b37c82e6a92df2575babcb17a6a8e9c505f7
+ '[' 5f91b37c82e6a92df2575babcb17a6a8e9c505f7 '!=' 5f91b37c82e6a92df2575babcb17a6a8e9c505f7 ']'
Checking parsing and highlighting...
Checking '~/Documents/tree-sitter/just/test/issue69-segfault.just': parse'
Unknown scope 'source.just'
Traceback (most recent call last):
  File "/var/folders/46/8kdrb66s5hg5bpjclp5wqpqh0000gn/T/just-M5x9MF/test-parse-highlight", line 208, in <module>
    sp.check_output(
  File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['npx', 'tree-sitter', 'parse', PosixPath('~/Documents/tree-sitter/just/test/issue69-segfault.just'), '--scope', 'source.just']' returned non-zero exit status 1.
error: Recipe `test-parse-highlight` failed with exit code 1

@tgross35
Copy link
Collaborator

There are probably some issues since you are on a much newer version of TS than the rest of this repo. Working on updating that in #166

@tgross35
Copy link
Collaborator

tgross35 commented Jun 24, 2024

Thanks for updating, could you rerun just setup (or only npm install --include=dev) and then rerun just gen; just fmt? Probably something got out of sync

@tgross35 tgross35 merged commit 379fbe3 into IndianBoy42:main Jun 25, 2024
4 checks passed
@tgross35
Copy link
Collaborator

Thank you for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[doc] attribute with argument is not supported
2 participants