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
Split CB documentation to smaller pages #6893
Conversation
af17a3b
to
af06aa3
Compare
af06aa3
to
aa57ef3
Compare
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 took me a while to realize the cleverness of this code.
I definitely needed some high-level explanation (and a warning) that creating documentation for an entry will also generate documentation for all entities in its module, allowing jumping over the module through links. The current documentation_ir
module docs are outdated.
(I hope it was tested for huge modules, like Base.Data
)
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.
I extended the documentation. We will generate module-level docs for every Method, Type or Constructor, not every type of entry (but pretty much for most of them). That's an unfortunate drawback, but it's hard to design the whole thing with links otherwise. One of the solutions is a documentation registry, but there are so much questions with cache invalidations there, that I don't even want to touch it.
As for testing, the new implementation actually does less work in some cases than the previous one, and the generation of IR was never an issue even on slow machines.
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.
Just a fast review, as Adam did deep one :)
page: Documentation::ModuleMethod { | ||
docs: method.clone_ref(), | ||
module_docs: docs.clone_ref(), |
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.
We could make it a lot shorter in many places by doing Documentation::ModuleMethod(&method, &module_docs)
and define its parameters in the new
fn as something: Into<...>
, This way it will work both for references and passing owned values, making the usage way nicer.
QA: 🍏 Looks good to me. |
This is so awesome! I'm just slightly surprised why we use the |
Yep, this is in the list of things to be fixed in the next PR. |
Pull Request Description
Now documentation for types, constructors and methods is displayed separately, with a links between pages.
It drastically improves the speed of documentation panel update (50-100x on my machine), and also provides more readable documentation.
2023-05-31.00-55-50.mp4
Before:
After:
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.