Add dexter_rename_symbol MCP tool - #2
Closed
shanehull wants to merge 1 commit into
Closed
Conversation
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
from
July 14, 2026 02:05
83ab2cb to
6ebee02
Compare
shanehull
force-pushed
the
feat/mcp-server
branch
from
July 14, 2026 02:05
c22bfdc to
3c1e34d
Compare
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
3 times, most recently
from
July 14, 2026 02:31
6ae9d82 to
5535f95
Compare
shanehull
force-pushed
the
feat/mcp-server
branch
from
July 14, 2026 02:38
3c1e34d to
a1a0a29
Compare
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
2 times, most recently
from
July 14, 2026 02:52
d2f7921 to
f8ce74d
Compare
shanehull
force-pushed
the
feat/mcp-server
branch
2 times, most recently
from
July 14, 2026 03:53
59a08f6 to
98c310f
Compare
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
from
July 14, 2026 03:54
f8ce74d to
4d755c9
Compare
shanehull
force-pushed
the
feat/mcp-server
branch
from
July 14, 2026 03:56
98c310f to
697a88b
Compare
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
from
July 14, 2026 03:56
4d755c9 to
e284f19
Compare
shanehull
force-pushed
the
feat/mcp-server
branch
from
July 14, 2026 03:57
697a88b to
18c5249
Compare
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
2 times, most recently
from
July 14, 2026 04:11
d39ec5f to
585f53b
Compare
shanehull
force-pushed
the
feat/mcp-server
branch
from
July 14, 2026 04:11
18c5249 to
c67b0e0
Compare
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
from
July 14, 2026 07:42
585f53b to
5f4567d
Compare
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
from
July 26, 2026 23:25
5f4567d to
bb121b0
Compare
Workspace-wide rename of a module or function, returned as a unified diff plus any file renames. Nothing is written: the agent applies the diff, performs the listed file moves, and calls dexter_reindex. The rename machinery writes to disk as it collects edits, so a plan/apply split was required: site collection and defdelegate span computation move verbatim from server.go to renameplan.go, where FunctionRenamePlan and ModuleRenamePlan compute the full new content of every affected file without touching disk. The LSP apply path is unchanged; TestFunctionRenamePlan_MatchesApply and TestModuleRenamePlan_MatchesApply assert a plan predicts the applied bytes exactly, and all pre-existing rename tests pass unmodified. internal/diff renders the plans as unified diffs, covered by golden tests including the missing-trailing-newline cases.
shanehull
force-pushed
the
feat/mcp-rename-tool
branch
from
August 19, 2026 23:45
bb121b0 to
476344d
Compare
shanehull
force-pushed
the
feat/mcp-server
branch
from
August 19, 2026 23:45
aefe30d to
b887331
Compare
Owner
Author
|
Superseded by remoteoss#85 (stacked on remoteoss#84) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on the MCP server PR (base branch
feat/mcp-server). Draft to share the idea.What
Adds
dexter_rename_symbol: workspace-wide rename of a module or function over MCP, returned as a unified diff plus a list of file renames. Nothing is written. The agent applies the diff, performs the listed file moves (module renames follow the file naming convention, including submodule cascades), then callsdexter_reindex.Why the refactor
The existing rename machinery writes to disk while it collects edits (closed files are written directly; only open buffers come back as TextEdits). A "return a diff, don't write" tool cannot be built on that, so this PR splits rename into plan and apply:
as:-span computation moved verbatim fromserver.gotorenameplan.go(git diffshows the block deletion; the logic is unchanged).FunctionRenamePlan/ModuleRenamePlancompute the full new content of every affected file, plus conventional new paths for moved files, without touching disk.renameFunctionEdits,moduleRename) is unchanged in behavior and consumes the same shared pieces.Correctness
TestFunctionRenamePlan_MatchesApplyandTestModuleRenamePlan_MatchesApply: after computing a plan, the LSP apply path runs and every plannedNewTextmust byte-match what landed on disk, and every changed file must be in the plan. This pins the two paths together permanently.TestRenameTool_DoesNotModifyDiskhashes every file before/after tool calls.internal/diff(new, self-contained) is covered by golden tests, including the missing-trailing-newline cases (expected outputs were validated againstgit applywhen written).Manually exercised on a large codebase: a 30-file rename plan (62 call sites) computed in 52ms, working tree verified untouched.