12

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.

Guillaume86
  • 14,341
  • 4
  • 53
  • 53
  • When you wrote "file/line" number, the "file" part you expect is a TFS Source Control location (e.g. $/MyTeamProject/MyBranch/MyFile.cs) ? – Nock Apr 24 '12 at 11:05
  • yes but it's just because I think it would be more convenient to deal with projects located in different physical locations in team members computers, a solution without TFS would still be a good start – Guillaume86 Apr 24 '12 at 12:32

3 Answers3

2

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 :)

Auri Rahimzadeh
  • 2,133
  • 15
  • 21
  • Thanks Auri - I was looking for something like this. It seems to work well as implemented. A couple of things that would improve the workflow for me: - I'd really like to see "Copy CodeLink" (i.e. to clipboard) on the context menu, as it's a distraction to have to hunt through the main menu when you're looking at the line of code. Also to have this go straight to clipboard without popping up a dialog that needs an extra click to dismiss. – Mike Dillamore Nov 01 '17 at 10:43
  • I definitely want to add the context menu... looking into how to do it, and find the time to add the feature :) Thanks for your feedback! – Auri Rahimzadeh Nov 02 '17 at 20:26
  • "Create workitem from selected code" would be a useful context menu item if you find the time. Do you have the extension in a public repo? – StingyJack Jul 22 '18 at 04:06
1

There's no such extension that exist from what I know.

However it wouldn't that hard to create a VSX that adds an entry in the Source Code context menu that will get the Source Control path from the Local Path using the TFS Api then putting the result in the clipboard.

In the meantime there's no easy way to come up with a workaround as I'm not aware of a way to get the Source Control path from the Local path in Visual Studio.

Nock
  • 6,561
  • 1
  • 28
  • 27
  • thanks for the input, yes the getting location/line number is not really the hard part, but the clickable link part sounds difficult, maybe http://stackoverflow.com/questions/3964152/how-do-i-create-a-custom-protocol-and-map-it-to-an-application could help (honestly, I'm afraid the time required to make that plugin would not worth it for me, that's why I asked about an existing solution and not about how to code it, I know, it's bad ^^) – Guillaume86 Apr 24 '12 at 13:31
1

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

  • 1
    Do you know which versions of TFS support this? Doesn't look like 2015 does. – Holistic Developer Feb 25 '20 at 20:44
  • 2
    This question is a duplicate of this question: https://stackoverflow.com/questions/36359580/tfs-web-portal-possible-to-link-uri-directly-to-line-number-in-file – AntonCassidaris Apr 08 '20 at 23:19
  • Not all versions are supporting this URL parameter! See answer from AntonCassidaris which provides an URL to the correct answer of this question! – hfrmobile Mar 15 '22 at 09:12