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

Add Prepare Rename Request #2894

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

rogancodes
Copy link
Contributor

@rogancodes rogancodes commented Nov 21, 2024

Motivation

Closes #2854

Implementation

If the position of the prepareRename request corresponds to a node of type Prism::ConstantReadNode, Prism::ConstantPathNode, or Prism::ConstantPathTargetNode, the range of the node will be returned; otherwise, it will return nil.

Automated Tests

Added new tests

Manual Tests

Screencast.from.21-11-24.10.34.25.PM.IST.webm

@rogancodes rogancodes requested a review from a team as a code owner November 21, 2024 17:11
@andyw8
Copy link
Contributor

andyw8 commented Nov 21, 2024

Nice! Do you know if the "The element can't be renamed" message can be customized?

@rogancodes
Copy link
Contributor Author

To set a customized message, the error code and message need to be included in the response.

@vinistock vinistock added server This pull request should be included in the server gem's release notes enhancement New feature or request labels Nov 27, 2024 — with Graphite App
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! This is essentially ready to ship, I just left a few minor comments to adjust.

lib/ruby_lsp/requests/prepare_rename.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/requests/prepare_rename.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/requests/prepare_rename.rb Outdated Show resolved Hide resolved
@vinistock vinistock merged commit 99d322a into Shopify:main Nov 27, 2024
22 checks passed
@rogancodes rogancodes deleted the feat/prepare_rename_request branch November 29, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide 'Rename Symbol' when not available
3 participants