Skip to content

meta: Extract revset parser as a separate crate - #9739

Closed
pksunkara wants to merge 1 commit into
mainfrom
pavan/jj/uuymxupm
Closed

meta: Extract revset parser as a separate crate#9739
pksunkara wants to merge 1 commit into
mainfrom
pavan/jj/uuymxupm

Conversation

@pksunkara

@pksunkara pksunkara commented Jul 2, 2026

Copy link
Copy Markdown
Member

I am working on a VSCode plugin and extracting the revset parser is needed for it. So, I submitted this PR. There were a few things I couldn't decide:

The following don't probably belong in jj_revset_parser crate, but it needs them:

  • content_hash.rs (and thus the proc_macro was changed)
  • ref_name.rs
  • fmt.rs (extracted from lib/src/revset.rs)

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes
  • I fully understand the code that I am submitting (what it does,
    how it works, how it's organized), including any code drafted by an LLM.
  • For any prose generated by an LLM, I have proof-read and copy-edited with
    an eye towards deleting anything that is irrelevant, clarifying anything
    that is confusing, and adding details that are relevant. This includes,
    for example, commit descriptions, PR descriptions, and code comments.

@pksunkara
pksunkara requested a review from a team as a code owner July 2, 2026 13:42
@pksunkara
pksunkara force-pushed the pavan/jj/uuymxupm branch from cb4f32c to ceccabd Compare July 2, 2026 13:53
@martinvonz

Copy link
Copy Markdown
Contributor

I am working on a VSCode plugin and extracting the revset parser is needed for it.

Why can you not depend on jj-cli?

@pksunkara

pksunkara commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

I am trying to compile the revset parser to wasm, which I am unable to do for jj_lib.

$ cargo check -p jj-lib --target wasm32-unknown-unknown

@yuja

yuja commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

You could use the tree-sitter parser. It should be able to handle text with syntax errors better (if that matters).

https://github.com/bryceberger/tree-sitter-jjrevset

@PhilipMetzger

Copy link
Copy Markdown
Contributor

This also is conflicting with my jj-core crate work FYI.

@PhilipMetzger

Copy link
Copy Markdown
Contributor

I am trying to compile the revset parser to wasm, which I am unable to do for jj_lib.

$ cargo check -p jj-lib --target wasm32-unknown-unknown

yes, building the library with wasm-unknown-unknown is a big headache, which also requires many downstream adjustments (see this Discord thread), I hope jj-core crate will also make parts of that easier.

@pksunkara

Copy link
Copy Markdown
Member Author

@PhilipMetzger If everything in this PR can be moved to jj-core crate, can we merge this (after I rename the crate)? We can incrementally add things to jj-core instead of waiting for a big PR.

@yuja

yuja commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

I'm not sure if the whole revset modules will be moved to jj-core. Maybe the revset parser and non-essential types will be placed between jj-core and the new jj-lib?

#6284 (comment)

@pksunkara

Copy link
Copy Markdown
Member Author

#9766 moved all of these into core.

@pksunkara pksunkara closed this Jul 7, 2026
@pksunkara
pksunkara deleted the pavan/jj/uuymxupm branch July 7, 2026 01:06
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.

4 participants