rust-lang / rust-lang/rust-analyzer
Field-based Type hierarchy
Nobody has claimed this yet.
- 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
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 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