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

"Extract Variable" refactor variable rename does not work #1133

Closed
machty opened this issue Oct 22, 2023 · 3 comments
Closed

"Extract Variable" refactor variable rename does not work #1133

machty opened this issue Oct 22, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@machty
Copy link

machty commented Oct 22, 2023

Ruby version

3.2.1

Code snippet

send challenges.sample

Description

When I select and extract "challenges.sample", it successfully extracts "new_variable" and selects it so that I can provide the variable name, but when I update the variable name, it only updates one variable name reference and not the other. Video demo:

extract_variable_bug.mp4

Expected output

See description

@machty machty added the bug Something isn't working label Oct 22, 2023
@vinistock
Copy link
Member

Thank you for the report! We haven't implemented the rename request yet #57, that's why it doesn't show up when extracting a variable.

This will be supported as soon as that issue is completed.

@vinistock vinistock closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2023
@machty
Copy link
Author

machty commented Oct 24, 2023

I think you could implement this without invoking the full machinery of the future Rename refactor... you just need to highlight / multi-cursor new_variable.

@vinistock
Copy link
Member

I think that would require returning a snippet from the refactor code action is which currently not supported by the LSP spec.

See microsoft/language-server-protocol#592 and microsoft/language-server-protocol#724.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants