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

Odoc 3: CLI for -L and -P #1132

Merged
merged 21 commits into from
Jun 5, 2024
Merged

Odoc 3: CLI for -L and -P #1132

merged 21 commits into from
Jun 5, 2024

Conversation

panglesd
Copy link
Collaborator

@panglesd panglesd commented May 23, 2024

This includes:

  • The -P and -L CLI options,
  • Several checks:
    • that no directory is contained another,
    • that the output file is contained in a package (this is disabled in case no -P, -L is passed)
  • (Lazily) storing file paths for each package in a hashtable
  • Functions for finding files them by name, or by path.
  • Tests for the checks
  • A test for finding by name, and finding by absolute path, using a hack.

The next stage is to implement new reference syntax, and integrate those "find by name" and "find by path" functions into the resolution of references.

src/odoc/resolver.ml Outdated Show resolved Hide resolved
@panglesd panglesd added the no changelog This pull request does not need a changelog entry label May 23, 2024
val create :
important_digests:bool ->
directories:Fs.Directory.t list ->
open_modules:string list ->
roots:roots option ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think docs should be updated to explain the roots options here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rereading this part, I noticed that some of my terminology might be wrong: for the -P it is the package name that is relevant, but for the -L it is the library name.

src/driver/odoc.ml Outdated Show resolved Hide resolved
Copy link
Collaborator

@EmileTrotignon EmileTrotignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no test for -L, is there a reason ?

panglesd and others added 21 commits June 5, 2024 09:31
And store the result in a "Named root" table. Many things are not implemented in
this commit: knowing which is the package of the current compilation unit,
tests, ...

Signed-off-by: Paul-Elliot <peada@free.fr>
This is just a refactor of the reference.ml file, for readability.

Signed-off-by: Paul-Elliot <peada@free.fr>
See https://ocaml.org/manual/5.2/core.html#ss:predef-exn :

> Exception raised by library functions to signal that the given arguments do
> not make sense. The string gives some information to the programmer. As a
> general rule, this exception should not be caught, it denotes a programming
> error and the code should be modified not to trigger it.

Signed-off-by: Paul-Elliot <peada@free.fr>
Some function took option input without any need for it!

Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
@jonludlam jonludlam merged commit 1ced6f2 into ocaml:master Jun 5, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This pull request does not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants