Skip to content

Conversation

@zth
Copy link
Member

@zth zth commented Sep 5, 2025

This adds a prepareRename command to the analysis bin that the editor tooling can use to get quick feedback for whether the target thing can be renamed or not.

Background for this is that our current rename functionality feels slow, and that's because it does all the heavy lifting of figuring out all places a rename needs to be applied, plus producing the actual text edits, twice - once to simply check if something can be renamed, and then again to do the actual rename. The command added in this PR replaces the first with a light weight super fast command that only looks at the untyped AST.

Will need adjustments in the editor tooling repo too for this to actually work.

@zth zth requested review from mediremi and nojaf September 5, 2025 19:53
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 5, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7847

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7847

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7847

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7847

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7847

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@7847

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7847

commit: cdc8ac1

Copy link
Member

@mediremi mediremi left a comment

Choose a reason for hiding this comment

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

LGTM ✔️

@zth zth merged commit 553bd9c into master Sep 6, 2025
25 checks passed
@zth zth deleted the prepare-rename-command branch September 6, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants