Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share a link to a location in code (source file / line number) in Visual Studio

I'm looking for a plugin (may be a TFS plugin) for Visual Studio 2010 that add a 'Copy uri' context menu entry in code editor and would make possible to copy paste a file/line number into an IM conversation (skype) or an email, and of course clicking the link would open the project/file at the correct line number (in an existing instance if VS if possible).

I'm working from home and that would be nice to be able to share easily a code location with team via skype (and sometimes email).

I googled and found nothing, but it's perhaps available in a big plugin like Resharper and not advertised.

like image 878
Guillaume86 Avatar asked Apr 23 '12 15:04

Guillaume86


People also ask

How do you show line numbers in VS code?

On the menu bar, choose Tools > Options. Expand the Text Editor node, and then select either the language you're using or All Languages to turn on line numbers in all supported programming languages. You can also type line number in the Search box, and then choose Turn line numbers on or off from the results.

How do you link a file with a VS code?

To link files, use the "Add Existing Item" dialog. One way of getting to this is to right-click on the project and choose "Add", then "Existing Item...". When the dialog opens, locate the file you want to link to.

How do I copy a file location in VSCode?

open your file on vscode> select file as active file> Ctrl + Shift + P > Alt + Shift + C now you can use Ctrl + V to paste this path any where you want.


2 Answers

Its not a plugin, but you can now add a line parameter (eg &line=1234) to a TFS file browser url, and then email that link to a colleague, it will open the file in a browser with the specified line highlighted. See example

like image 91
AntonCassidaris Avatar answered Sep 28 '22 00:09

AntonCassidaris


I wrote an extension for this. It's called CodeLink:

https://marketplace.visualstudio.com/items?itemName=AuriRahimzadeh.CodeLinktm

I'm looking for testers and feedback. I only have so many solutions with which to test it :)

like image 22
Auri Rahimzadeh Avatar answered Sep 28 '22 01:09

Auri Rahimzadeh