Is there any way to open the regular editor for a code file from the diff view in Visual Studio? - visual-studio

If I double click a file in Pending Changes, I get the diff view, which is nice, but sometimes I want to edit the file instead. Is there any way to bring up the regular editor from the diff view or from Pending Changes? What I've been doing is searching for the file in Solution Explorer, but that's kind of slow and I was hoping there was a way to bring up the editor directly from the diff view or from Pending Changes.

The difference viewer built into Visual Studio provides a basic read only file view; so the answer is no ... not for out of the box Visual Studio tool. But not external applications.
I recommend that you use a purpose built diff viewer and specify it to be used by visual studio that will launch into the external program.
I personally have been using Araxis Merge which allows one to view/edit the local copy. It then allows you to save to the local file during a difference view.

Related

Change Ctrl+Click Behavior in VS Output Window

Is there a way to change how links are opened from the Output Window (not an Editor)?
Meaning, when the Output Windows detects a link, it's Ctrl+Click-able and opens in an Internet Explorer tab.
I'd like to change the target from IE to the Text Editor and still within Visual Studio.
There are solutions for changing the click behavior in an Editor, but I am asking specifically about the Output Window. I understand the answer might just be no.
There's a Visual Studio Extension that lets you open URIs in the browser (https://visualstudiogallery.msdn.microsoft.com/46c0c49e-f825-454b-9f6a-48b216797eb5).
I've forked it and made some updates so that it will handle file:/// URIs as well, opening them in the Visual Studio editor or an external editor. I've published a debug version that hasn't been very heavily tested here. You can peruse the full source of my fork here, or the original source here.
This makes debugging/working with the BizTalk map/schema tools a lot better...

Visual Studio Diff Tool - When is Editing Allowed?

I'm using Visual Studio 2013 and tfs 2013. Sometimes I'll make a code change and click compare with latest version. The diff tool will open and allows me to edit the file in the diff tool. However other times it will not let me edit but will read only.
Is there some setting or something I need to do for me always allow edit?
In a database project I've noticed that it never lets me edit in the diff tool. Is there some setting I need to change?
I've searched around online but haven't found any answers to this.
Thank you.
Editing in the Diff viewer is only allowed for certain file types. It doesn't support editing .sql files and there is no VS setting to allow that.
Visual Studio Diff Window: How to Edit .sql Files
Have you tried other diff tools like WinMerge or Beyond Compare?
In Visual Studio, go
Tools-->Options-->Visual Studio Team Foundation Server-->Configure User Tools,
add the extensions of the file types you would like to compare and under Command,
input the path of the diff tool (in my case it is Beyond Compare)
Other answers are correct as well but do not cover all the cases.
Visual studio will not allow you to edit file during compare if the panel you are trying to edit does not correspond directly to the file in your working directory.
You can easily tell by the address bar on top of the compare panel. If it ends with HEAD or Index - you will not be able to edit the file.

How does Visual Studio choose which editor to use for a file?

My project stores html code fragments for use in templating in files with a custom extension (*.phtml). I find that Visual Studio is inconsistent in its use of editors when I edit these files. Sometimes it provides no intellisense, sometimes it treats the files as XML (which is better than nothing), and sometimes I get lucky and it provides me with the HTML editor.
I've configured Visual Studio to treat *.phtml files as HTML, but that doesn't seem to make any difference.
What more can I do to convince Visual Studio to always use the HTML Editor for *.phtml files?
Right-clicking a file in solution explorer shows an "Open with ..." option, the window that it opens has a choice of editors plus a "Set as default" option.

Is it possible to change the Visual Studio Schema Compare diff tool?

When you click a row in the result set of a Visual Studio's Schema Comparison, it shows a diff of the source vs. the target of the comparison. Is there any way to use a different diff tool for that comparison?
This largely depends on which Source Control type you are using. But very often there are option pages associated with the Source Control option
Tools->Options->Source Control.
For example, Subversion has a setting called Subversion User Tools under this menu, that allows you to specify an external diff tool.
If TFS, then there is a menu option called Visual Studio Team Foundation Server. On this property page, is a button called Configure User Tools...
Other source control systems have similar mechanisms

Hidding source control files within Visual Studio's solution tree

We use Visual Studio 2008 and Surround SCM for source control. SCM drops files into each directory named ".MySCMServerInfo" which are user specific data files that shouldn't be checked into source control. They are similar to the .scc files dropped by Visual Source Safe. We also have several WAPs (Web Application Projects) that we develop. All these .MySCMServerInfo files show up in the solution tree and the Pending Checkins window when they should not. There has to be some way to force VS to ignore files of a given extension because it ignores .scc files. How do I get VS to ignore .MySCMServerInfo files within a WAP?
I have new information about this issue. Setting the hidden bit on .MySCMServerInfo file causes Surround SCM to loose track of the modification state for files. It starts thinking files are out-of-date when they are not, and it always attemps to get new versions.
Instead, set this registry key if you're using Visual Studio 2008:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\
{8FF02D1A-C177-4ac8-A62F-88FC6EA65F57}\IgnorableFiles\.MySCMServerInfo]
Set this registry key if you're using Visual Studio 2005:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\
{8FF02D1A-C177-4ac8-A62F-88FC6EA65F57}\IgnorableFiles\.MySCMServerInfo]
These will tell Visual Studio to not display .MySCMServerInfo files within the Solution tree and the Pending Checkins view.
Using the file system hidden bit should work.
Late Answer but hopefully useful to others.
I began experiencing this problem when using Visual Studio 2015 with the new ASP.Net 5 Project templates. (I presume this is because the new templates automatically include everything in the folder rather than only showing the things that are listed in the project file).
Showing these files in the Solution explorer change be prevented by right clicking the file and selecting "Hide from Solution Explorer" but this didn't prevent SCM from including them in the Pending Check-ins Window.
The correct way to deal with this problem is:
Select the file(s) in Solution Explorer
Select the File > Source Control > Exclude from Source Control
Reference
NOTE: Right Click in the Solution Explorer DOESN'T have this option.

Resources