Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc comments not showing up on hover for certain methods #6676

Open
jez opened this issue Jan 23, 2023 · 1 comment
Open

Doc comments not showing up on hover for certain methods #6676

jez opened this issue Jan 23, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers IDE Relating to Sorbet's LSP server or VS Code extension

Comments

@jez
Copy link
Collaborator

jez commented Jan 23, 2023

Input

→ View on sorbet.run

# typed: true
extend T::Sig

# docs that should show up on hover
# ... they show up if you delete `end_time` as a parameter
# Are we doing some source-parsing heuristics that get in the way?
sig do
  params(
    merchant: String,
    product_features: T::Array[String],
    start_time: Integer,
    end_time: T.nilable(Integer),
  )
    .void
end
def example(
  merchant:,
  product_features:,
  start_time:,
  end_time:
)
  puts(merchant)
end

Observed output

No errors! Great job.

When you hover on the call in def call, the doc comment doesn't appear in the hover text.

Expected behavior

The doc comment should appear in the hover text.


Note that if you delete the end_time variable from the sig and the method def, the doc comment shows up in the hover text. I wonder if we're doing something artificially limiting like counting lines limiting when trying to find a method's comment?

@jez jez added bug Something isn't working good first issue Good for newcomers IDE Relating to Sorbet's LSP server or VS Code extension labels Jan 23, 2023
@Graham42
Copy link

I found another instance of this bug. This time the difference is using sig do...end vs sig {...}

sorbet.run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers IDE Relating to Sorbet's LSP server or VS Code extension
Projects
None yet
Development

No branches or pull requests

2 participants