rust-lang / rust-lang/rust-analyzer
[Feature Request] Automatic documentation comment generation (for methods, types, mods, etc.)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Coming from the worlds of both .NET/Visual Studio and Python, one of the creature comforts I got to expect from an IDE is the automatic generation of documentation comments (or at least the boilerplate for one) for certain types of data (functions/classes, etc).
Most of the crates I have encountered so far have superb documentation. However, the documentation are usually written by hand, and I imagine having an automated tool for generating at least the boilerplate could streamline the process.
Here's an example from a VSCode extension which accomplishes similar goals for python:

In my research, I encountered RFC1574. Furthermore, adopting this suggestion on how implement documentation in a machine-readable way could open up the way for automatic generation of said boilerplate and allow for more fixes in the future, such as:
- Checking for compliance with the structure above.
- Suggesting the user to change the documentation after changes in the code (e.g. adding/removing/reordering function arguments, etc.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading RFC1574 and the linked machine-readable inline documentation proposal, then compare their goals with rust-analyzer's current capabilities. The issue does not name files, tests, or an entry point; work is complete only after the scope and implementation approach for generating documentation-comment boilerplate are defined and accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100