In Eclipse (for Java) I got used to the function Copy Qualified Name available in the context menu of the code window, which copied the fully qualified name of a type or method under the cursor into the clipboard. After switching to Visual Studio I am unable find an equivalent of this useful tool.
Is there a Copy Qualified Name function somewhere in Visual Studio? (Or is it in some plugin?)
If not, is there at least a good workaround which does not require a successful build and launch of my application nor forces me to manually re-type a qualified name visible somewhere on the screen?
I'm currently using VS 2012 Pro and need this in a Visual Basic project.
"Copy" will literally copy the object you have selected and "Copy Qualified Name" will copy the name of the object including the package or path information of the element you are coping.
A qualified name consists of a name, a " . " token, and an identifier. In determining the meaning of a name (§6.5), the Java language takes into account the context in which the name appears. It distinguishes among contexts where a name must denote (refer to) a package (§6.5.
The latest version of ReSharper includes the ReSharper_CopyFqn
command, which will copy a fully-qualified type name to the clipboard for the currently selected symbol.
Not sure if this will be convenient enough for you, but you can choose View
menu item and open the Class view
window (Ctrl+W,C
or Ctrl+Shift+C
short cut - probably depends on the settings). There you can select a class or a method and pressing Ctrl+C
(or choosing Copy
from context menu) gives you the fully qualified name in the clipboard.
I'm not sure if this still needed, but I just published extension to copy qualified name in Visual studio, you can find it here: https://visualstudiogallery.msdn.microsoft.com/f15022a5-aec4-44e7-a51d-6c24df3b55e0
Quite a long time I was using the command in answer I got for this question. Too bad that the Visual Studio command given in accepted answer is:
Few weeks ago I asked author of Supercharger Visual Studio plugin to add the functionality in there and he found it useful and added it. This is now quite comfortable way to get the fully qualified name. The view is similar to original Class View pane, but is synchronized with current location in code, so finding desired member is painless, compared to procedure in original Class View pane. Here's an image of open context menu on sample SortedLines
property:
I'm using ReSharper Ultimate 2017.3.2, where you can select "ReSharper" > "Edit" > "Copy XML-Doc ID to Clipboard":
The copied string looks like this:
M:EnEffCoWeb.Chart.ColorPickerTemplate.InstantiateIn(System.Web.UI.Control)
Update from 2022: In ReSharper, ReSharper_CopyFqn
is now "Copy code reference to clipboard"
The shortcut is Ctrl+Alt+Shift+C
:
When you need to log or share the context of the current location, such as the name of the symbol under the caret or its XML-documentation ID, the path to the file or the VCS path, you can press Ctrl+Alt+Shift+C and copy the desired reference from a popup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With