6 ms·
Show HN: CodeLink: create links to blocks of code in your IDE
Small team down here in South New Zealand just launched CodeLink. In short its an IDE (VSCode/JetBrains) plugin that lets you share blocks of code that link directly to the code inside your IDE or repo. We use it all the time and think its pretty nifty tech that lets you understand someone’s code in context very quickly. we’re hoping to keep refining it to make it better and more useful.
- harryvederci 4y agoLooks great, congrats! Oh and "Codemunication" was a proper dad-level joke, made me chuckle :)
- rupertdenton 4y agoThanks haha - yes plenty of dad energy here.
- speuleralert 4y agoI’ve been thinking about something like this for years - super psyched to see a team working on it! A feature I’d really love is a linked list of these code pointers, so send someone a link to a “flow” where they can step through each code snippet with the spacebar or left/right arrows, with optional accompanying text for each step. I’m imagining onboarding myself or someone else to a massive monorepo, or tracing through a flow scattered across several microservices contained in separate repositories.
- rupertdenton 4y agoThat is awesome feedback. We actually have some features on our roadmap that really align with this. Its great to have it validated here, so thank you for taking the time to respond. We are a small team, but really passionate about making something really helpful!
- ok_dad 4y agohttps://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour https://marketplace.visualstudio.com/items?itemName=vsls-con... For example
- deleted 4y ago[deleted]
- rupertdenton 4y agoHey! Thanks again for this - I wanted to pass on some additional comments from our Founder too. He was really interested in your response but was having trouble posting. Nice! So you've seen what a CodeLink is. Imagine if that link was a snippet of code embedded in a web doc, like Google Docs or Confluence. You could then write a tutorial with snippet blocks that - when clicked - load up the repo and highlight that code in your editor. Plot twist, we've built it: CodeNote (www.codenote.dev) - think Notion but for Developers. It works hand in hand with CodeLink. We use it to onboard all new devs and for technical design specs etc. We've got a closed Beta group actively using it. If you like, jump on the wait list on the website and we'll get you in the next group. Looking forward to seeing you in there and getting your feedback!
- jackconsidine 4y agoWhoa this is awesome. To accomplish this currently I do: - Open up VSCode terminal and git log to get commit hash - Ctrl + P > Gitlens: Open on remote with (paste hash so the link probably won't die or change as opposed to 'main') Definitely going to install and check out, it sounds way simpler
- deleted 4y ago[deleted]
- rupertdenton 4y agoThat is awesome to hear, thanks so much. We've also got slack integration so your codelinks unfurl really nicely in Slack (if you use it with your teams/friends/community). We're really keen for feedback so please do share the good and the "needs work" (especially the "needs work" haha)
- smcleod 4y agoThis comes built in to vscode, you right click on any piece of code and select 'copy as github permalink', done. https://i.imgur.com/hJ1WnZT.png https://i.imgur.com/hJ1WnZT.png
- rupertdenton 4y agoHey, thanks for the comment. Another commenter also shared this plugin, looks interesting! We are trying to really help devs get on the same page fast when sharing code with one another - so the codelinks you can share via CodeLink unfurl in slack (we've got more integrations coming too) and link directly to the code in your repo or IDE. We also integrate with JetBrains which was some feedback we got from our early users. Also some other nifty tricks we've built into CodeLink: CodeLink auto loads the lines of code in VS Code, JetBrains, GitHub, GitLab, BitBucket etc. If you don't have the repo locally, it'll check it out for you. If you're not on the right commit/branch it'll swap to it for you. If you share the link on slack, it'll unfurl the snippet there. If you've forgotten where you shared the link, you can click on the "backlinks" and load up the exact thread in Slack where you shared it. (Bloody hell should have included this all in OP!!) Definitely keen for feedback so appreciate yours, keep it coming!
- LoganDark 4y ago> If you don't have the repo locally, it'll check it out for you. If you're not on the right commit/branch it'll swap to it for you. Does it ask to do this? Checking out a branch is not so simple, maybe I have modified files locally and don't want to stash them right now.
- waigani 4y ago
- rupertdenton 4y agoYep! It does this. You'll be prompted with a popup to confirm if you want to switch branches. If you don't confirm it won't do anything.
- LarsDu88 4y agoSorry mate, but this vscode extension does the same thing: https://marketplace.visualstudio.com/items?itemName=hogashi.vscode-copy-github-permalink https://marketplace.visualstudio.com/items?itemName=hogashi.... but links directly to the code in question, no frills
- rupertdenton 4y agoHey! Thanks for sharing this plugin, looks interesting. I think a few differences here (I could be wrong as I am not overly familiar with this plugin you have shared). CodeLink lets you manage a list of your links on CodeLink, it has slack integration so the codelinks can be shared directly in slack and unfurl there helping people get on the same page quickly. Also CodeLink integrates with JetBrains. Some other cool things CodeLink can do: CodeLink auto loads the lines of code in VS Code, JetBrains, GitHub, GitLab, BitBucket etc. If you don't have the repo locally, it'll check it out for you. If you're not on the right commit/branch it'll swap to it for you. If you share the link on slack, it'll unfurl the snippet there. If you've forgotten where you shared the link, you can click on the "backlinks" and load up the exact thread in Slack where you shared it. We're looking to integrate it with Teams and Discord in the near future too! But yeah please do keep the feedback coming.
- waigani 4y ago
- MilStdJunkie 4y agoI do something like this with Asciidoc's include directive, but including to a tagged region in the source, with the tags in a block comment. The include lives in a code block, so it gets formatted right.
- rupertdenton 4y agoThat's really interesting. How do you find using that process? I haven't seen it in action.
- MilStdJunkie 4y agoSorry for the delay! I made up an example in Python. See also https://docs.asciidoctor.org/asciidoc/latest/directives/include-tagged-regions/ https://docs.asciidoctor.org/asciidoc/latest/directives/incl... Asciidoc document: // Asciidoc begins = Test include to code Here's a paragraph. Let's take a look at a code block plus an include [source, python] ---- include::loops.py[tag=count] ---- Python code filename loops.py # Python begins # // tag::count[] count = 0 # // end::count[] while count < 5: print(count) count += 1 # This is the same as count = count + 1 Output (text) - this is formatted in HTML or PDF as title, para, then a code block Test include to code Here’s a paragraph. Let’s take a look at a code block plus an include count = 0
- efitz 4y ago[old man voice, hitching up trousers] In my day we used to call them “line numbers”.
- rupertdenton 4y agoHahaha. Onion on belt energy: https://www.youtube.com/watch?v=a6Dc7W6jXCo https://www.youtube.com/watch?v=a6Dc7W6jXCo
- jsejcksn 4y agoIs Slack the only integration? How about support for other platforms? (e.g. Discord is more popular than Slack) Will you support standardized formats like oembed (https://oembed.com/ https://oembed.com/) so that any platform/service which supports such a format can render the code?
- rupertdenton 4y agoThanks so much for the comment. Yes further integrations are definitely on our very near future roadmap, oembed too!
- grantjpowell 4y agoIf you use the vim fugitive plugin[1], The `:Gbrowse` command [2] will open your browser to github on the correct file/commit. It also works on visually selected ranges, automatically linking to the range in github [1] https://github.com/tpope/vim-fugitive https://github.com/tpope/vim-fugitive [2] https://github.com/tpope/vim-fugitive/blob/master/doc/fugitive.txt#L243-L266 https://github.com/tpope/vim-fugitive/blob/master/doc/fugiti...
- rupertdenton 4y agoHey! Thanks for the comment. CodeLink also auto loads lines of code seamlessly in VS Code, JetBrains, GitHub, GitLab, BitBucket etc. It also makes it easy if you don't have the repo locally - it'll check it out for you. If you're not on the right commit/branch it'll swap to it for you. It'll also unfurl the code on Slack (more integrations inbound!) and allow people you share it with to open it up in their IDE or VCS! Hopefully makes life easier for our fellow devs :)
- oblak001 4y agoiam bot
- red0point 4y agoWhat do you do about security here? Isn‘t automatically checking out and opening a repository after clicking a link quite a risky affair? Does it bypass the „do you trust this repo“ screen put up by VSCode?
- rupertdenton 4y agoHey there, really important question. There's no security risk here. If you don't have the creds to access the repo, there is no way you can check out the code. You can try this CodeLink to see how it works: codelink.dev/CKy5YDEZg. The link is to our open demo repo on GitHub. Click open in VS Code or JetBrains and you'll see the prompt in your editor to select a folder to check the code into, it'll then open the file and highlight the lines.
- somada141 4y agoReally like it and kudos on launching. Copying GH permalinks to sections of code is something I do about 30 times a day to augment my Slack posts, GH issues, personal notes, Confluence documentation, etc. I gotta say though, I don't know that I'd trust CodeLink to be around 1-2 years down the track and if it's not then all that work will be far less valuable without the code being accessible through links that will no longer function. I truly hope this project gets traction and becomes a mainstay but until it does I couldn't see myself adopting it.
- waigani 4y ago
- rupertdenton 4y agoHey, thanks so much for the kudos. This is a solid point. I'm going to talk with the team about prioritising an export function. Each CodeNote is essentially a node of links to that code (and conversations about that code) in other places: VCS Hosts, editors, Slack etc. The generated VCS Host and Slack permalinks are not dependant on us. So we can, at least, create a dump of those in short order. We use websockets to locate the code in editors, but could easily downgrade these to protocol links (e.g. `vscode:`) that are independent of us also. What format would be most useful for the dump to be in? JSON, CSV, markdown ...? I'm thinking JSON just from a data organisation perspective?
- somada141 4y agoThanks for the reply! I think any canonical export format would be valuable and would give users some peace of mind :)