sourcebot-dev / sourcebot

Blazingly fast code search 🏎️ Deployed as a single Docker image 📦 Search million+ lines of code in your GitHub, GitLab, and Gitea repositories 🪄 MIT licensed ✅
https://sourcebot.dev
MIT License
1.17k stars 38 forks source link

Support Line Number Highlighting #15

Open nevetS opened 2 months ago

nevetS commented 2 months ago

It would be nice to be able to use this tool in code reviews.

something like repo=repoalias&file=main.py&highlight=20-25,48-49,117

That way, you could leave a comment that had highlighted lines. You could also use it just to share bits of code with other developers - "This is the code we were discussing earlier".

brendan-kellam commented 2 months ago

Thanks for raising the issue! If I understand correctly, this almost sounds like a "deep linking" feature where you are able to make a code selection, right click and "copy link to selection". Does that sound right?

Out of curiosity, what are you using for code reviews? And does it have a feature like this?

vjo commented 1 week ago

+1

I came here to request this exact feature, it's pretty common, see:

You often need to link someone to a part of the code base.

KonradStanski commented 1 week ago

I feel like this should not be implemented in the query URL path, but for a dedicated code browsing path. Once this is created, you should be able to select lines and share URLs with the file path and lines selected. Line selection should probably not be enabled in the query page, since the URL is not persistently shareable in any meaningful way.