Skip to content

fix(filesystem): treat edit replacements literally#4160

Open
Lubrsy706 wants to merge 1 commit into
modelcontextprotocol:mainfrom
Lubrsy706:fix/filesystem-literal-dollar-edits
Open

fix(filesystem): treat edit replacements literally#4160
Lubrsy706 wants to merge 1 commit into
modelcontextprotocol:mainfrom
Lubrsy706:fix/filesystem-literal-dollar-edits

Conversation

@Lubrsy706
Copy link
Copy Markdown

Fixes #4157.

Summary

  • use a replacement callback so edit_file newText is inserted literally instead of being interpreted as a String.prototype.replace replacement pattern
  • add regression coverage for literal $, $&, $1, and $$ content in replacements

Testing

  • npm --prefix src/filesystem test

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.

filesystem: edit_file newText interpreted as String.prototype.replace replacement-pattern (literal $ corrupted)

1 participant