Shopify / Shopify/ruby-lsp

Implement `typeHierarchy/subtypes` requests support

Open
#2,144 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement pinned
Dominant language
Ruby
Stars
2k
Forks
281
Avg merge
2h 14m
Merged PRs (30d)
6

Description

Description

Follow up to https://github.com/Shopify/ruby-lsp/issues/1046 and https://github.com/Shopify/ruby-lsp/pull/2103.

We currently handle textDocument/prepareTypeHierarchy request and typeHierarchy/supertypes requests but the structure of the index doesn't allow for easy descendants lookup.

A partial solution would be to iterate over the whole linearization hash, though since the linearization is lazy, we will be missing entries. It would be better to think about a new data structure to support this feature.

LSP specification: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#typeHierarchy_subtypes.

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 reading the existing handling for textDocument/prepareTypeHierarchy and typeHierarchy/supertypes, then review the index and its lazy linearization hash. Compare the requested behavior with the LSP typeHierarchy/subtypes specification and the linked issue and pull request. Done means descendants can be returned reliably, including entries not yet present through lazy lookup.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.