-
Notifications
You must be signed in to change notification settings - Fork 61
feat(ci): test against nvim-treesitter highlights #169
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
Conversation
|
|
||
| - name: checkout scala/scala | ||
| if: ${{ runner.os != 'Windows' }} | ||
| if: ${{ runner.os == 'Linux' }} |
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.
Not exactly related to this but I realized we are cloning this on mac as well, but not running the smoke tests on mac. So I just switched this back to only clone on the os that we actually run it on.
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.
As a separate point, I think we can extract the Linux workflow as a separate thing, and on Mac/Windows just do npm run build && npm run test.
To declutter all those if conditionals.
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 can try to follow-up with another pr and clean this up.
This PR starts testing against the highlights that nvim-treesitter has defined to ensure we don't break things without warning. The general flow is as follows: - When on linux we clone nvim-treesitter - After all of our initial testing we copy the queries that they have defined - If they differ, we run our highlight tests against them - We also issue a warning that the highlights have diverged (more than likely this will fail the highlighting tests anyways) This is in ref to tree-sitter#136
6b666a2 to
69c4f8e
Compare
| run: | | ||
| echo "::warning file=queries/highlights.scm::Queries in this repo are out of sync with nvim-treesitter" | ||
| git diff queries/highlights.scm | ||
| npm run test |
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.
Pretty sure the answer is "yes", but for discussion sake: should we necessarily fail the job if the queries are out of date?
PRs often change tree structure, and sometimes rename nodes - which breaks queries.
My personal opinion is that we are at a point (unless there's some catastrophic parser mistake current grammar has) where we can stabilise and treat breaking changes with a lot more care.
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.
My personal opinion is that we are at a point (unless there's some catastrophic parser mistake current grammar has) where we can stabilise and treat breaking changes with a lot more care.
I agree, except I'd say stabilize. If a PR breaks existing queries we should try working around it by creating a dummy node, or at least know that we are in that territory.
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.


This PR starts testing against the highlights that nvim-treesitter has
defined to ensure we don't break things without warning. The general
flow is as follows:
defined
likely this will fail the highlighting tests anyways)
This is in ref to #136. @keynmol let me know if this is what you had in mind.