Remix.run Logo
SoftTalker 2 hours ago

> changing a commonly used fn to take a locale parameter

I have to ask, is this the sort of thing people use agents/AI for?

Because I'd probably reach for sed or awk.

pavel_lishin 2 hours ago | parent | next [-]

I think about half the IDEs I've ever used just had this as a feature. Right-click on function, click on "change signature", wait a few seconds, verify with `git diff`.

unshavedyak an hour ago | parent | next [-]

I actually still like LLMs for this. I use rust LSP (rust analyzer) and it supports this, but LLMs will additionally go through and reword all of the documentation, doc links, comments, var names in other funcs in one go, etc.

Are they perfect? Far from it. But it's more comprehensive. Additionally simple refactors like this are insanely fast to review and so it's really easy to spot a bad change or etc. Plus i'm in Rust so it's typed very heavily.

In a lot of scenarios i'd prefer an AST grep over an LSP rename, but hat also doesn't cover the docs/comments/etc.

ep103 an hour ago | parent | prev [-]

yeah, and this has the advantage of both being deterministic, and only updating things that are actually linked as opposed to also accidentally updating naming collisions

mrbnprck an hour ago | parent [-]

Arguably its only a matter of making lsp features available to the coding agent via tool calls (CLI, MCP) to prevent the model start doing such changes "manually" but rather use the deterministic tools.

jxf 2 hours ago | parent | prev | next [-]

It's not always amenable to grepping. But this is a great use case for AST searches, and is part of the reason that LSP tools should really be better integrated with agents.

esafak a minute ago | parent | next [-]

Agents do use LSPs.

skydhash an hour ago | parent | prev | next [-]

Programming language are formal, so unless you’re doing magic stuff (eval and reflection), you can probably grep into a file, eliminate false positive cases, then do a bit of awk or shell scripting with sed. Or use Vim or Emacs tooling.

philipwhiuk 2 hours ago | parent | prev [-]

Ah yes, don't fix the agents, fix the tools.

What a ridiculously backwards approach.

We were supposed to get agents who could use human tooling. Instead we are apparently told to write interfaces for this stumbling expensive mess to use.

Maybe, just maybe, if the human can know to, and use, the AST tool fine, the problem is not the tool but the agent.

scottlamb 2 hours ago | parent | prev | next [-]

In general, yes, I might use an LLM for a tedious refactor. In this case I might try <https://github.com/ast-grep/ast-grep> though.

Arch485 2 hours ago | parent | prev [-]

Or the "find all references" feature almost every code editor has...