Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
IDE or text editor integrations #163
I wanted to pop an issue in here to discuss or report on integrations.
About a year back I had made an Atom integration that made the built-in search seamlessly use livegrep as a backend. It worked quite well, although it had a number of UX quirks with how to enable livegrep searching and return to Atom's find-and-replace behaviour.
I'd be more than happy to revisit the Atom one I had made and clean it up. Has anyone given considerations to making integrations?
I'd love to see some editor integrations.
There are two main features I think an editor integration could provide:
From what I saw inside Dropbox, I think the make-a-link feature would actually be even more valuable than the search-backend feature. This wasn't what I expected when I first deployed it there, but for most people the seconds it might take a tool like ripgrep to search in our codebase was fast enough... and what we heard most often from users who really valued livegrep was instead that the use case that made it indispensable was linking to code so they could talk about it.
On my current project, the codebase is a lot smaller and
It sounds like your previous integration was mainly about the search-backend feature. If that's what you're excited to build, awesome. Consider this a request to try adding the other thing too. :-)
Yea, that's a great idea.
That isn't a far stretch and the only major change would be making it easy to use. When I implemented the search-backend functionality, the plugin it would populate the search results and also indicate if the result was local (in an open project) or remote. When you clicked on a result it would open locally if possible otherwise a livegrep page was opened.
With Atom the tricky part was making it behave with find-and-replace. Instead of duplicating everything they had, I simply had a toggle for livegrep mode and it would hijack all of the existing DOM for the built-in search. Adding a
Cool. The one thing I'd add about my requested feature: I'd actually decouple it entirely from searching or find-and-replace. The workflow I have in mind is more like, there's some code I'm looking at -- I may have gotten there through any means, maybe a search, maybe I searched for something I knew was nearby and then scrolled to it, maybe I was just editing some code and noticed something I wanted to start a conversation about somewhere -- and I want to make a link I can share that points to that line on a livegrep file-viewing page.
So the UI is probably basically a key shortcut and it copies to the clipboard, and maybe acknowledges somewhere that it's done so. (I haven't used Atom much, but this would go in the message area at the bottom of Emacs, or in Material/Android terms it'd be a "snackbar" or a "toast".)
Though it totally also makes sense to me to have the search-backend feature optionally produce a link to the corresponding livegrep search-results page.
The key piece that this feature shares with the search-backend feature is really the part where the user configures where the livegrep install is. That and someone knowing/learning enough of the editor's APIs to build an integration at all. :-)
I use https://github.com/sshaw/git-link pretty heavily in my editor to get github links, and I'm +1 to the feature in general for sites that use livegrep as their code browser. We don't, so I wouldn't personally use it today.
I do think a slick editor integration for search would be really nice. I recently switched from Linux to a mac, and