🙌 LSP-Integrated File Editing Tools #1733
arnm
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
I hadn’t heard about OpenCode before, thanks for sharing! It does look really promising. I’ve actually been playing with Gemini-cli the past few days; it’s fun having all those free tokens 😂 With so many extensions out there now, I’m planning to create a GitHub org and add them all as proper CodeCompanion extensions. I’ll invite you to join! since it's your extensions :) While it’s great to check the LSP, many tools are already included in the plugin, but I see the value in something like multi-edit. Thank you! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’ve added a set of file editing tools for CodeCompanion agents in Neovim, inspired by OpenCode. These tools help LLM agents work with files more efficiently and safely:
codecompanion-lsp-files-edits.mp4
Tools
Write File Tool
Create or overwrite files, with LSP formatting and diagnostics right after.
Edit File Tool
Replace text in a file using smart matching (handles whitespace, indentation, etc.), then runs LSP formatting and checks for errors.
Multi-Edit File Tool
Batch multiple edits to a file in one go—each edit is applied in sequence, and the whole thing is atomic (all succeed or none). LSP formatting and diagnostics run at the end.
Why use these?
This is especially useful for more capable LLMs that can plan and apply several changes at once.
Code:
https://gist.github.com/arnm/fa65dbf96bd6de51d7689991a61f0dc3
If you’re building agent workflows or want to automate code changes safely, these are worth a look!
Beta Was this translation helpful? Give feedback.
All reactions