Shopify / Shopify/ruby-lsp

Initialize signature showing Object.new signature but not the specific class signature

Open
#2,585 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug help-wanted non-vscode pinned
Dominant language
Ruby
Stars
2k
Forks
281
Avg merge
2h 14m
Merged PRs (30d)
6

Description

Description
Reproduction steps
  1. Create a class with an initialize method, give it no documentation.
  2. In another place, instantiate this class
  3. The signature help displays class.rbs help. It doesn't matter if the signature is different or no.
  4. I would expect at least to see the signature.

This may be an issue with the neovim/lsp configuration, I'm wondering if other people see this too. I have seen this with my classes, but also with gems. The classes for the gems are loaded correctly, however when I try to instantiate it, I don't see the signature. Could be related to https://github.com/Shopify/ruby-lsp/pull/2553 ?

I've created a Dockerfile where you can see this happening. There are some annoying warnings, I need to update the Dockerfile.

curl -o Dockerfile https://gist.githubusercontent.com/dgmora/f869b0692db5fafdf6d43090ec9cb46f/raw/Dockerfile && \
  docker build -t lazyvim-lsp . && \
  docker run -it lazyvim-lsp
# `nvim` to start neovim
# inside:
#   `<space>`  to see available keymaps (and wait) 
#   `<space>e` to toggle filetree
#   `a`        to create a file in the file tree

Image

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 using the linked Dockerfile to reproduce the signature-help behavior in Neovim, then inspect the reported relationship to ruby-lsp PR #2553. Compare instantiating a class with an undocumented initialize method against the displayed Object.new or class.rbs signature; done means signature help shows the specific class signature for local classes and gems.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, neovim, ruby
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.