-
Notifications
You must be signed in to change notification settings - Fork 415
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
[dir_contents] Allow qualified traversal of directories. #1980
Conversation
82aa456
to
897c780
Compare
2de5136
to
bb7179c
Compare
In retrospect, we should have probably made this stanza a field in the library/exectuable/coqlib stanzas, but whatever. |
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.
It's good enough to merge. @ejgallego please don't forget to add the parsing error when coq isn't enabled as a project.
At first I thought that would make sense, so the qualified part was "local" to the |
bb7179c
to
01dbe95
Compare
Done, thanks! You may want to check the implementation, but I think it is OK. |
Umm, actually @rgrinberg I am having trouble querying the ; "include_subdirs",
(let+ () = Syntax.since Stanza.syntax (1, 1)
and+ t =
let t = ??? in
let enable_qualified =
Option.is_some (Dune_project.find_extension_args t Coq.key) in
Include_subdirs.decode ~enable_qualified
and+ loc = loc in
[Include_subdirs (loc, t)]) however this doesn't seem like the right place I'm afraid. |
There's a similar code path when setting up formatting rules, you can have a look at how it works there. |
Thanks @emillon , I am not sure tho that I should access the super context at parsing time, it seems somehow to complicate things too much, right? Maybe the parsing check is too much of a trouble if the a |
The dune project is always in scope when parsing. Otherwise, we can't parse as we don't know what extensions are enabled. You can simply call |
01dbe95
to
5099f2e
Compare
Thanks @rgrinberg , somehow I missed the type on this one. Rebased; will merge once CI is happy. |
This is a cherry-pick of the directory traversal parts from the Dune PR (ocaml#1968). I was uncomfortable with the misnaming done there, so this PR enables the `(include_subdirs qualified)` syntax and provides a `local` part to the traversal so clients [such as the Coq mode] can use it. Note that this does introduce a bit of overhead in the tree traversal, especially in deep trees, it should be possible to optimize if we deem it necessary. Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
5099f2e
to
f355cb0
Compare
This is a cherry-pick of the directory traversal parts from the Dune
PR (#1968) plus a modification to enable the
qualified
mode inside(include_subdirs ...)
I was uncomfortable with the misnaming done there, so this PR enables
the
(include_subdirs qualified)
syntax and provides alocal
partto the traversal so clients [such as the Coq mode] can use it.
Note that this does introduce a bit of overhead in the tree traversal,
especially in deep trees, it should be possible to optimize if we deem
it necessary.