rust-lang / rust-lang/rust-analyzer

Autocomplete cargo doc paths/links to types in doc comment

Open
#4,759 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-completion E-hard S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

I've opened this same issue in intellij-rust, but figured I'd also open it here since I'm interested in both tools.

Here's the copy pasted issue:


If you write something like the following in a doc comment

/// An error returned by [`RefCell::try_borrow`](struct.RefCell.html#method.try_borrow).
#[stable(feature = "try_borrow", since = "1.13.0")]
pub struct BorrowError {
    _private: (),
}

The struct.RefCell.html#method.try_borrow your documentation site will link to the try_borrow method when you click on the RefCell::try_borrow link.

Since the naming convention for pages / links within a cargo doc generated site is consistent - could intellij-rust support autocomplete for these links?

This would make it much easier to write documentation that references other types/methods within your library.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Rust doc-comment example in the issue and compare the requested behavior with the linked intellij-rust issue. The work is done when autocomplete can suggest paths or links to types and methods referenced in cargo doc-style links within documentation comments.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.