-
-
Notifications
You must be signed in to change notification settings - Fork 139
Add override modifier #163
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
|
I don't know what those new files are. @maxbrunsfeld would know. My guess is either you ran a command from the wrong folder or there's been a recent change in |
|
@mjambon is this even the right way of adding the override modifier at least? |
|
It looks reasonable based on what we already have but I wonder about the order of all these modifiers. Do they have to come in this particular order e.g. |
|
If you find out that the order of the modifiers is well defined, then we can merge the current implementation. Otherwise if it's not clear or the order doesn't matter, we can instead parse them as: repeat(choice($.static, $.override, $.readonly, ...))This tolerates duplicates but I think it would be fine. |
|
I think that if @mjambon's suggestion works, we should prefer it, because that format generally results in significantly fewer parse states, which makes the parser faster and smaller to download. There are likely to be restrictions on the allowed order, but it's reasonable to regard violations of those restrictions as semantic errors, not syntax errors. |
|
So I did go through and fix the ordering at least in the |
|
|
@maxbrunsfeld this PR adds several new generated files, presumably due to recent versions of tree-sitter generating more files. Should they be added or git-ignored?
|
|
@rmagatti sorry for not responding earlier. To expedite this, could please check the checkbox items? I see that the tests don't pass because of |
|
Thanks for the review @mjambon I'll try and get back to this as soon as I can. |
|
@mjambon would you mind kicking off the workflows? I'd like to see if things look good now. |
|
@rmagatti what about my two earlier comments? |
|
@maxbrunsfeld what about these new generated files mentioned in my earlier comment? |
Oh wow, idk how I missed those, I'll check them out! |
|
@mjambon One of the comments is addressed. The one about the conflict I'm not sure how to improve on, at least from a quick look. 😅 |
|
Yeah I don't know enough about how this works to know how to not have to add the conflict. 😞 |
|
@rmagatti we need an answer from @maxbrunsfeld about all those new generated files. Do they need to be git-ignored? As an aside: Personally, I think generated files should not be placed in a source repo because:
Problem (2) can be avoided by requiring an admin or a bot to generate the files. The solution we're using for semgrep is to treat generated code as build artifacts, and put them into their own git(hub) repo. |
|
Yeah, despite having very little context on this particular project overall I agree with your side point as a general principle @mjambon. |
|
These newly generated files should be removed from this PR, because they're redundant with similarly named files in the repo root. See #135 (comment) for more details, and tree-sitter/tree-sitter#1243 for a top-level tree-sitter-wide discussion about generated files. |
| version "0.19.0" | ||
| resolved "https://codeload.github.com/tree-sitter/tree-sitter-javascript/tar.gz/2c5b138ea488259dbf11a34595042eb261965259" | ||
| dependencies: | ||
| nan "^2.12.1" |
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.
Do we need this yarn.lock?
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 is usually a committed file to keep actual package versions consistent. I can remove it , but I'd recommend having it in the repo.
|
Could you add a test for |
I'll give it a try, haven't looked at how tests work for this yet. Good thing the weekend is right around the corner 😄 |
|
Added a simple query test @mjambon |
|
great. Merging! |

Really new at this.
Initially this looks like more files than I'd want to commit, maybe missing a .gitignore or something.
Checklist: