Skip to content

Add Prepare Rename Request - #2894

Merged
vinistock merged 2 commits into
Shopify:mainfrom
ro-gun:feat/prepare_rename_request
Nov 27, 2024
Merged

Add Prepare Rename Request#2894
vinistock merged 2 commits into
Shopify:mainfrom
ro-gun:feat/prepare_rename_request

Conversation

@ro-gun

@ro-gunro-gun commented Nov 21, 2024

Copy link
Copy Markdown
Contributor

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

@ro-gun
ro-gun requested a review from a team as a code ownerNovember 21, 2024 17:11
@andyw8

Copy link
Copy Markdown
Contributor

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

@ro-gun

Copy link
Copy Markdown
ContributorAuthor

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

@vinistockvinistock 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

@vinistockvinistock left a comment

Copy link
Copy Markdown
Member

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.

Comment threadlib/ruby_lsp/requests/prepare_rename.rb Outdated
Comment threadlib/ruby_lsp/requests/prepare_rename.rb Outdated
Comment threadlib/ruby_lsp/requests/prepare_rename.rb Outdated
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or requestserverThis 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

@ro-gun@andyw8@vinistock