This is a simple issue, and I hope someone can help
For reasons I don't think I need to explain, my XAML thinks it has some errors in it in the Visual Studio code editor (which shows as wavy blue underlines across most of my XAML).
Does anyone know how to turn this underlining off in Visual Studio 2012 ?
It's incredibly annoying, and makes my XAML hard to read
Thanks
I would suggest setting the editor for .xaml-files manually.
Go into
Tools->Options->Text Editor->File Extension
Write xaml in the Extension field and choose XML (Text) Editor from the Editor drop down and then click Add.
Your XAML files should now open as ordinary XML files, without error underlining.
You will probably loose a lot of the nice to have features of the XAML editor, but as far as I know (I've struggled a bit with this myself) it is the only way.
Found this on MSDN. There is a specific setting to disable this.
Open the Options dialog by selecting Tools > Options, and then select
Text Editor > XAML > Miscellaneous.
Uncheck the Show errors detected
by the XAML designer check box.
Article from MSDN
It is possible to hide the SquiggleShape by making the surrounding adornment layer hidden or collapsed using the Snoop tool.
To achieve this, the Snoop crosshair tool has to be dragged on the editor window with shift and ctrl keys pressed (keep them pressed a while when releasing mouse button). You should end on some Canvas (with the editor window highlighted), and below there is some ViewStack. Inside, there are some AdornmentLayer, one of which contains multiple SquiggleShape. In the properties section on the right side of the Snoop window, scroll to the Visibility row and select the value Hidden or Collapsed. Now, the squiggle lines are not visible any more.
This involves some manual work, but as long as the file stays open, the squiggle lines are hidden. In principle, it should be possible to write an extension which hides the lines automatically. However, at the moment I don't find the time to do this...
The only decent fix for this silly bug that I can find is right click on the xaml and click open with. Select source code editor (without with encoding). Not a great fix when you consider it gets rid of important errors. But it should help you read it better for the most part.
Another Option for this is to change the color of the line under: Tools > Options > Environment > Fonts and Colors. Change it to the same as the background.
It will turn it off in all other editors also though.
Related
I remember once while using Microsoft Visual Studio, opening a source file (by accident I think) and having it render in either subdued colors or with a different background and showing a watermark indicating that this file was not a normal editable source file. I was under severe time pressure then and unfortunately can't recall the file or the wording of the watermark (or I would be able to investigate unaided).
Does this ring a bell with anybody? Is there a way to cause MVS to display auto-generated files in a different manner so that the developer does not waste time editing something that should not be edited? I open plenty of auto-generated files all the time (usually as a result of some global search) and it would be helpful to have all such files render in the editor this way.
The MVS version in question is Microsoft Visual Studio Professional 2015. I have Resharper and OzCode as well.
I was having this same problem. For the files I work with (web stuff, js, css, etc.) the watermark is applied by Web Compiler: "Shows a watermark when opening a generated file" (see features list in https://github.com/madskristensen/WebCompiler).
It turns out the "Generated" mark is toggled by clicking the bottom right corner of the editor window. In fact, it is always there, however if you accidentally click it, that will cause it to be hidden UNLESS you mouse over the bottom right corner of the editor window of the generated file.
So, to re-enable the watermark:
Open a file you know for sure is generated, like one of the output files in your compilerconfig.json file.
In the editor window, mouse over the bottom right corner of the window. You should see the "Generated" text re-appear, with a tooltip that says "Click to toggle visibility".
Click the text. From now on the "Generated" watermark will show up in your generated files. Just be sure not to accidentally click and hide it again.
-Michael
In Visual Studio 2012 it's a lot of margins to the left of source code text: Indicator Margin, Selection Margin and Outline Margin. As an old programmer i prefer an uncluttered text, so i want all 3 margins to be hidden from me. In Text editor settings i can hide indicator and selection margins, but i didn't found how to hide an outline margins. Outline graphics (all this "+" things and ines) can be easily hidden from "edit" menu, but margins itself remains. Is it possible to hide it or such feature is not implemented? In previous versions of Visual Studio it auto-hides if "selection margin" was disabled, but now it seems that it don't hide at all :(.
Update
A little clarification why I need it. As correctly mentioned in comments, it's very unusual to have preferences for text formatting and appearance. I agree with that. Unfortunately, in my personal case, I work with text like 10 hours per day for dozens of years and my brain is kind of trained to calculate indentation from text editor left edge. And every time I work in Visual Studio my "wrong indentation" instinct is often triggered by this empty space :). Of course i can re-train myself, but since ALL editors except Visual Studio displays text close to left edge, I will try to configure Visual Studio first.
Turn off the Indicator margin with Tools + Options, Text Editor, General, untick "Indicator margin"
Turn off the Selection margin with Tools + Options, Text Editor, General, untick "Selection margin"
Turn off the Outline bar with Edit + Outlining, Stop Outlining. That is however liable to come back when you open a new file. You can make it consistent for the C# IDE with Tools + Options, Text Editor, C#, Advanced, untick "Enter outlining mode when files open". If you want to do this for other kinds of files as well then you need to write an add-in that listens for the DocumentEventsClass.DocumentOpened event.
I've created an extension for this, it's for VS2015 but if you haven't upgraded yet it should work for VS2012 as well (assuming you're using an edition that supports extensions). The source code is only a few lines and is shown in the screenshot of the posted link.
http://blogs.msdn.com/b/saraford/archive/2007/09/13/did-you-know-you-can-hide-outlining-selection-margin-without-turning-off-outlining.aspx
Tools – Options – Text Editor – General, and uncheck Selection Margin...
This work?
Go to VisualStudio->Tools->Options
Drill down to Text Editor->C#->Advanced and uncheck "Enter outlining mode when files open"
Other language editors have similar options to disable outlining mode.
Any files you have open before changing this setting need to be re-opened, or you can turn off outlining from the context menu for each open file. Easier to just close/re-open.
Hope that helps!
Here's an extension that worked perfectly for me: https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotSettings
It has custom options to hide/show:
the entire margin
breakpoint margin
line numbers
selection margin
I can't tell if anyone actually answered your question (which is mine today!). Please see http://www.codeproject.com/Articles/109611/Color-Indicator-for-Code-Changes-Track-Changes-in and particularly the "Enable / Disable" section: "Go to Tools > Options > TextEditor. In General section, you can check or uncheck the 'Track Change' option."
Agree this feature is a big visual hassle during initial development, but it can be helpful during "maintenance" changes.
Corrected per "external link" comment.
On my laptop I try to maximize workspace within Visual Studio. If I'm just dealing with code, I keep all of my panels on the left and right hidden via auto-hide.
However, if I'm working in Design mode I pin the toolbox, properties, etc so they're always visible. I was hoping to find a way to actually hide the panels when I tab to a file only dealing with text (not in Design mode), and regain the panel when I return to a tab in Design mode, no manual pinning/unpinning required. I'm not fond of just mousing over the panel tab so it pops into view. I like to keep them permanently there while in Design mode.
Going from http://i.stack.imgur.com/yYmHu.png to http://i.stack.imgur.com/AQLGP.png is basically what I'm referring to.
Thanks!
Im not sure if there's a better way but I was able to create a macro to do this. Open Macro IDE in Tools -> Macros -> Macros IDE. Open EnvironmentEvents under MyMacros. Add the following code:
Private Sub WindowEvents_WindowActivated(ByVal GotFocus As EnvDTE.Window, ByVal LostFocus As EnvDTE.Window) Handles WindowEvents.WindowActivated
If GotFocus.Caption.EndsWith(" [Design]") Then
DTE.Windows.Item(Constants.vsWindowKindProperties).AutoHides = False
Else
DTE.Windows.Item(Constants.vsWindowKindProperties).AutoHides = True
End If
End Sub
If the properties panel is not already opened, you add this code to open:
DTE.ExecuteCommand("View.PropertiesWindow")
Try to use Perspectives extension. After installing you can save your current layout as perspective (just like in Eclipse) in Visual Studio 2010 and then switch between them. The only bad thing is what you can't switch between them automatically. I don't know maybe we can modify sources of extension(if it's available).
Visual Studio tries to be helpful by showing all the nested tags where the cursor is (the display at the bottom of the code window, next to the "Desgn | Split | Source" options), but I never use it, and it seems to slow things down when I'm just trying to cursor past large blocks of code. Is there any way to turn this feature off?
A quick look at the Tools -> Options -> HTML Designer options doesn't seem to provide a way to turn this off. You can set the default view, but there is no on/off option.
I'm trying to customize some TFS work items via the VS2008 xml editor, but every time I open a work item xml file it jumps to the graphical designer. All that gives me is a "View XML" button that doesn't let you edit the xml directly.
I don't have TFS but I know in regular VS there is an Open With... option in most items' contextual menu that even let you change the default editor. Very useful when you are tired of the Designer opening instead of the Code file on Windows forms.
Ah, looks like you have to go to File->Open and click the down arrow next to the Open button to "Open With" the xml editor. If someone wants to copy and paste this, free accepted answer :P
As per Coincoin's answer, this feature is also great for setting the default editor for ASPX. If you want to go to the Code Editor most often, then this is a default you'd want to change.
Reading this - I think perhaps you don't realize - that there is no need to edit the XML - in fact it is very difficult to do so. The graphical designer will actually let you change the Work Item type, adding new fields, changing workflow, rules etc.
The only reason to change the XML is if there's a bug in the Process Editor (the tool that gives the graphic designer). I have done extensive modifications of Work Item types and only had one instance where I had to change the XML.