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

Conditionally provide hints/definitions on typed files. #2294

Open
1 task done
Jesse-Cameron opened this issue Jul 11, 2024 · 1 comment
Open
1 task done

Conditionally provide hints/definitions on typed files. #2294

Jesse-Cameron opened this issue Jul 11, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request pinned This issue or pull request is pinned and won't be marked as stale

Comments

@Jesse-Cameron
Copy link

I have checked that this feature is not already implemented

  • This feature does not exist

Use case

Our ruby codebase uses sorbet types in some of it'sfiles (lots of typed: false still hanging around). So devs like to have both ruby-lsp and the sorbet lsp running, one for the typed files and one for untyped files.

This works well for the untyped files as sorbet tends not display signature helpers/definitions etc. But once we are in the realm of typed: true, both ruby-lsp and sorbet will try do similar things. So sometimes both of the LSP's will provide similar information/details.

Description

I think that it would be great if the ruby lsp were to integrate a little tighter with the sorbet LSP. We could give users control of which typed files are worth displaying hints on. I'm thinking a setting that allows users to toggle whether we want ruby-lsp to be suggesting on typed: {true|strict} files.

Implementation

No response

@Jesse-Cameron Jesse-Cameron added the enhancement New feature or request label Jul 11, 2024
@vinistock
Copy link
Member

Thanks for opening the issue!

Before we can have deeper integration with Sorbet, there are already some things we can do:

  1. I believe Sorbet is always able to provide completion, go to definition and hover for methods that are invoked on a class or on self. We should double-check if this is the case and then there's no need to offer these for declarations made inside the workspace on typed: true files or higher
  2. We should not show any instance variable functionality on typed: strict files, since Sorbet enforces that every variable must be annotated

@vinistock vinistock added the pinned This issue or pull request is pinned and won't be marked as stale label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned This issue or pull request is pinned and won't be marked as stale
Projects
None yet
Development

No branches or pull requests

3 participants