News for hackers. Stuff that matters.
Re:Comby - Structural code search and replace for every lang... by kretaceous on Tuesday May 17, 2022 @02:20PM (#31414509)
Okay wow. I didn't tools like this existed! There's been more than once where I've found myself in a situation like "find all code like this, change if this, delete if this". Regex can only get you so far.

Does someone know if this or something similar is available as a VSCode extension? It'd be fun to make one if not!

Re:Comby - Structural code search and replace for every lang... by vanesa- on Tuesday May 17, 2022 @07:06PM (#31417295)
Sourcegraph Community Manager here. You can use the Sourcegraph extension for VSCode [1] that would allow you to have the structural search powered by Comby (or literal or regular expression search) inside of VSCode.

You can't do batch changes[2] inside of VSCode yet, only via the Sourcegraph CLI[3]. We're working on expanding this.

[1] https://marketplace.visualstudio.com/items?itemName=sourcegr... [2] https://docs.sourcegraph.com/batch_changes/explanations/intr... [3] https://docs.sourcegraph.com/cli

Re:Comby - Structural code search and replace for every lang... by kretaceous on Tuesday May 17, 2022 @08:03PM (#31417685)
Thanks for letting me know. I'll try it right away.
Re:Comby - Structural code search and replace for every lang... by horlux on Wednesday May 18, 2022 @04:34AM (#31420468)
anything similar for vim?
Re:Comby - Structural code search and replace for every lang... by vanesa- on Wednesday May 18, 2022 @09:25PM (#31429643)
We don't have an extension for Vim yet, but you can use Sourcegraph CLI[1] in your terminal. Feel free to file a feature request[2] though, which should help bump up the prioritization of a proper Vim extension.

[1] https://docs.sourcegraph.com/cli [2] https://github.com/sourcegraph/sourcegraph/issues/new?assign...

Re:Comby - Structural code search and replace for every lang... by ducktective on Tuesday May 17, 2022 @03:30PM (#31415320)
language-server methods like rename
Re:Comby - Structural code search and replace for every lang... by kretaceous on Tuesday May 17, 2022 @07:55PM (#31417626)
Yes. I regularly use this feature sky-high I was looking for something more advanced as vanesa- spoke in the sibling comment.
Re:Comby - Structural code search and replace for every lang... by kretaceous on Tuesday May 17, 2022 @08:00PM (#31417658)
- sky-high + but

Swiping fiasco. When do we get the edit comment feature in HN? :)

Re:Comby - Structural code search and replace for every lang... by vore on Tuesday May 17, 2022 @08:18PM (#31417777)
You should be able to edit comments within 2? hours of posting. Maybe this link works for you? https://news.ycombinator.com/edit?id=31417626