Tidy up the docs in auto-generated Rust bindings#4294
Merged
amaanq merged 1 commit intotree-sitter:masterfrom Apr 19, 2025
Merged
Tidy up the docs in auto-generated Rust bindings#4294amaanq merged 1 commit intotree-sitter:masterfrom
amaanq merged 1 commit intotree-sitter:masterfrom
Conversation
Contributor
Author
|
Seems it's fixed. :D |
lib.rs files
BenjaminBrienen
approved these changes
Mar 31, 2025
WillLillis
approved these changes
Apr 1, 2025
Member
|
nice, thanks! |
|
Successfully created backport PR for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there! I was looking into tree-sitter out of curiousity, and while messing about with it, I noticed that the doc-comments in the generated Rust bindings were formatted a little oddly.
I thought to tidy up the doc-comments a little. In particular, I did the following things:
I removed a couple useless
[]which appear after the text portion of a link. For example,[tree-sitter][]became[tree-sitter]. Thanks to how markdown handles reference-style links, these still link to the same place.Where a link refers to a item (such as a struct or const), I changed the link's text to be in backticks, such that it shows up in a
in-line code block. For example,[Parser]became[`Parser`]. This brings item links in line with how many Rust crates link to items.I changed the link to
tree_sitter::Parserto include the exact version of thetree_sittercrate used by the binding crate, rather than version*. This ensures that the linked documentation links to the relevant version of the crate (whether the relevant version is the latest version or not).I removed the reference link definition for
tree_sitter_language::LanguageFn. This causes rustdoc to link to theLanguageFnitem that's already in scope - which incidentally also ensures that the link will go to the exact version oftree_sitter_languageused by the binding crate.This should not result in any functional or visual differences to the doc (aside from the
LANGUAGEandParserlinks now looking like in-line code blocks).