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

Rename an undefined variable #7876

Open
qaisjp opened this issue May 7, 2024 · 2 comments
Open

Rename an undefined variable #7876

qaisjp opened this issue May 7, 2024 · 2 comments
Labels
enhancement New feature or surprising current feature IDE Relating to Sorbet's LSP server or VS Code extension

Comments

@qaisjp
Copy link
Collaborator

qaisjp commented May 7, 2024

Input

→ View on sorbet.run

puts({repo: pr.repo, author: pr.author})

Press F2 on pr and type pull_ctx in the rename prompt.

Observed output

In Visual Studio Code, I get:

The `<no-method>` method cannot be renamed.

Expected behavior

The rename should work.

Instead, I have to add a pr = nil, then rename pr, and then delete the new line.


@qaisjp qaisjp added bug Something isn't working unconfirmed This issue has not yet been confirmed by the Sorbet team labels May 7, 2024
@jez jez added enhancement New feature or surprising current feature IDE Relating to Sorbet's LSP server or VS Code extension and removed bug Something isn't working unconfirmed This issue has not yet been confirmed by the Sorbet team labels May 7, 2024
@jez
Copy link
Collaborator

jez commented May 7, 2024

While the feature request is admirable, I worry that there's no convenient way to implement this in Sorbet. I'm happy for someone to prove me wrong, but I would not hold out hope for this to get fixed soon.

@jez
Copy link
Collaborator

jez commented May 7, 2024

It's worth noting that TypeScript doesn't appear to implement this feature either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or surprising current feature IDE Relating to Sorbet's LSP server or VS Code extension
Projects
None yet
Development

No branches or pull requests

2 participants