rust-lang / rust-lang/rust-analyzer

[feature request] more ide features (hover, goto definition, completion/fly-imports, etc...) in documentation code snippets.

Open
#12,400 5 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer already provides highlighting in these code snippets in documentation:

image

I think that it would be really awesome if we could also provide some IDE features in these snippets, namely hover, inlay hints, goto defintion and autocomplete/flyimports, rename, and maybe even diagnostics (perhaps diagnostics/inlay hints should only be active while your cursor is within the doc snippet to not be annoying outside of editing the snippet). It would make writing documentation examples much much easier and delightful too.

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 by examining the existing highlighting provided by rust-analyzer in documentation code snippets. Define which requested IDE features—hover, inlay hints, goto definition, autocomplete or fly-imports, rename, and diagnostics—are in scope, then verify that the selected features work in those snippets without making diagnostics or inlay hints distracting outside the snippet.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, documentation, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.