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 to use JuliaSyntax.jl v1.0.0 #9

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

inkydragon
Copy link
Member

@inkydragon inkydragon commented Jan 28, 2025

This pr should be merged with the PR that updates the JuliaSyntax.jl version.
The tests here are currently invalid (because JuliaSyntax.jl has not been upgraded yet)

JuliaSyntax.jl Breaking changes:

@tecosaur
Copy link
Collaborator

Brilliant, thanks for doing this work Chengyu!

@inkydragon
Copy link
Member Author

inkydragon commented Jan 30, 2025

I think this pr is ready for review.
See buildkite status: https://buildkite.com/julialang/julia-master/builds/44217#0194b630-15b6-4d08-afdc-0e261d34973a

But not sure when to merge it.

One idea is to keep this pr open, and

Otherwise this pr will not pass CI.

(Update)
We need a stable commit hash and perhaps need to merge this PR first.

@inkydragon inkydragon marked this pull request as ready for review January 30, 2025 14:08
@inkydragon inkydragon changed the title WIP: update to use JuliaSyntax.jl v1.0.0 update to use JuliaSyntax.jl v1.0.0 Jan 30, 2025
@inkydragon inkydragon closed this Feb 8, 2025
@inkydragon inkydragon reopened this Feb 8, 2025
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 58.82353% with 7 lines in your changes missing coverage. Please review.

Project coverage is 66.87%. Comparing base (d6c979e) to head (2680c8b).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/JuliaSyntaxHighlighting.jl 58.82% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   66.66%   66.87%   +0.21%     
==========================================
  Files           1        1              
  Lines         156      157       +1     
==========================================
+ Hits          104      105       +1     
  Misses         52       52              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tecosaur
Copy link
Collaborator

tecosaur commented Feb 10, 2025

Great! I'll try to review this PR in the week, seems like it should be good to just merge?

Feel free to ping me if I don't get around to this by the weekend 🙂

The source changes:
1. Replace K"true" and K"false" with K"Bool"
   JuliaLang/JuliaSyntax.jl@b92fc5e5dab7
2. Rename haschildren() to is_leaf()
   JuliaLang/JuliaSyntax.jl@d8796c6ac136

Also update the tests and doctests to reflect a change in the syntax pass.
Instead of just reaching straight into the private fields of the
relevant structs, (import and) use the methods provided by JuliaSyntax.

Specifically:
1. length(node.args)       -> numchildren(node)
2. isempty(children(node)) -> numchildren(node) == 0
3. node.args               -> children(node)
4. node.args[x]            -> node[x]
5. node.span               -> span(node)
@tecosaur
Copy link
Collaborator

Sorry it's dragged on, I've just looked over these changes locally and they look good to me 👍. Thanks again for your work on this.

I'd like to fast-forward merge this, but rebasing the work into these three commits:

21edd86 Update the minimum Julia version to v1.12
67e8d6c Adapt to breaking changes with JuliaSyntax

The source changes:
1. Replace K"true" and K"false" with K"Bool"
   JuliaLang/JuliaSyntax.jl@b92fc5e5dab7
2. Rename haschildren() to is_leaf()
   JuliaLang/JuliaSyntax.jl@d8796c6ac136

Also update the tests and doctests to reflect a change in the syntax pass.
317f2c8 Use the more idiomatic JuliaSyntax API

Instead of just reaching straight into the private fields of the
relevant structs, (import and) use the methods provided by JuliaSyntax.

Specifically:
1. length(node.args)       -> numchildren(node)
2. isempty(children(node)) -> numchildren(node) == 0
3. node.args               -> children(node)
4. node.args[x]            -> node[x]
5. node.span               -> span(node)

Let me know if you're happy with this 🙂

@inkydragon
Copy link
Member Author

I'm fine with those changes.
I'm not good at writing commit messages, so I always opt for each commit to contain as few changes as possible so that merging multiple commits is easy.

Feel free to push -f

@tecosaur
Copy link
Collaborator

tecosaur commented Feb 25, 2025

I've just checked and K"Bool" causes an error on JuliaSyntax < 1.0, so I'm also going to need to bump the compat when backporting this (note to self).

@tecosaur tecosaur merged commit c221b4e into JuliaLang:main Feb 25, 2025
4 checks passed
@tecosaur
Copy link
Collaborator

Thanks for the help!

@inkydragon inkydragon deleted the JuliaSyntax-v1.0 branch February 25, 2025 12:50
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.

2 participants