rust-lang / rust-lang/rust-analyzer

Field-based Type hierarchy

Open
#19,987 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Sometimes I would love to know what types embed a given other type. It would be great if r-a could somehow show such a field embedding hierarchy. The lsp has a type hierarchy request model for sub and supertypes, I feel like we can maybe make use of this? https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_prepareTypeHierarchy

Alternatively of course we could also do an lsp extension here.

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 linked LSP 3.17 textDocument/prepareTypeHierarchy specification and determine how field-based embedding differs from its sub- and supertypes model. Then identify the rust-analyzer entry points and tests for type hierarchy requests; done means rust-analyzer can show which types embed a selected type through the standard request or a documented extension.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.