Sorry for question but I can't find answer anywhere on internet. I couldn't find answer myself either. Here is question:
Previously when I clicked anywhere in VS text editor cursor moved to the end of statement, just after ";". But now it stays where I click on the screen and it is really annoying. How can I address this issue. Thanks in advance.
This is called Virtual Space and can be changed in Visual Studio's options dialog.
As per the MSDN article:
To position comments beside your code
In the Options dialog box, expand Text Editor, and then click the
General node for your development language.
Under Settings, select Enable virtual space.
When this option is selected and Word wrap is cleared, you can click
anywhere beyond the end of a line in the Code Editor and type.
To revert to the behaviour you're after, you need to uncheck Enable virtual space either at the language level or for all languages:
Also more here.
In Visual Studio 2019, you must check the Tools - Options -Text Editor - All Languages - Scroll Bars then check the Show caret position option.
Related
I'm using Visual Studio 2019 and it grays some of my variables in my codes that weren't grayed in Visual Studio 2017.
For example, if I write "Variable = null" (assuming the specific Variable is already declared and has a value inserted inside) then it grays it and suggests to delete that line.
These suggestions are destructing me, and annoy my eyes as the color of the codes keep on changing.
How can I disable those specific suggestions (and not disabling suggestions totally) or at least not allowing it to become light gray, changing its color to black or not letting it effect the previous color.
How can I disable those specific suggestions
You can disable the suggestion (not just the formatting, but the actual suggestion itself) by clicking the lightbulb icon in the gutter of the editor window (), and choosing the "Configure or Suppress issues" menu item in the popup menu.
For the issue you're asking about, "Remove unused members", that's IDE0051. Select the "Suppress" menu item for that issue, and choose from one of the three options. For keeping the code file itself clean, using the "in Supression File" is best. It will track that particular line of code, but in a separate file, out of the way of the code itself.
Color Theme Designer plugin can solve the problem.
The light gray colour of text can be changed to a colour of choice using this free plugin.
Color Theme Designer can be downloaded from
https://marketplace.visualstudio.com/items?itemName=ms-madsk.ColorThemeDesigner
I haven't found a solution, but I've found something that will be useful for me, perhaps a bug in visual studio 2019 basic themes.
The theme Blue (Extra Contrast) color of the text that's supposed to be grayed - isn't getting grayed, infect it's effected only by the setting of User Members - Locals (and perhaps other user member types, but the colors depend on them and the text isn't getting grayed).
I just upgraded to VS2017, and I'm having issues with the Code Outlining. Specifically, I want methods, regions, classes to stay outlined and collapse/expand as they did in VS2015, but I don't want if/for and other code blocks to be outlined. I want them to always be expanded.
Anybody know how to do this?
Thanks
Turns out I found it myself in the settings.
In the Menu bar, Go to Tools->Options, then follow the trail in the image below to get the fix.
VS Settings
(I don't have enough reputation to post the image, so the link goes to it. If you don't want to go there, it's Tools->Options, then Text Editor->C#->Advanced and uncheck "Show outlining for code level constructs")
So I've been working with Visual Studio 2010 lately. While I'm not a huge fan of Eclipse, I do miss one feature: the fact that if you click on a function or variable in your code, it will mark all occurrences of that thing on the right frame of the text editor with a yellow or white rectangle. Does such a feature exist in Visual Studio? If not, is there a plugin out there that'll do this? I really don't want to resort to Find All every time I need to keep track where something is used.
Highlight References is feature in Visual Studio 2010 for C# and VB only. Any time you place the blinking caret on a symbol, Visual Studio will automatically highlight all instances of that symbol for you You can actually cycle through these highlighted references – just use Ctrl+Shift+up arrow and Ctrl+Shift+down arrow to move to the previous or next highlighted symbol.
The ProductivityPowerTools is what you may need. There you have a bar where you can see a minimized view of all your code. If you click there you can also navigate your code. But if you click within your actual code on a member, all occurences of this member are shown in the map.
Press Ctrl-K then Ctrl-R, this will find all references to the method (or object, variable, etc.)
In Visual Studio 2010, if you hover your mouse over the little [-] minus sign, it will highlight that block of code for you. My question is, is there a way for this block to always be highlighted while you are coding inside of it? That way, as I'm hopping between methods and classes, whatever block I'm currently working on would be highlighted to help my eyes quickly focus.
Is there an option within Visual Studio for this? If not, are there any plugins that do this?
Resharper has some options for this, one will let you outline the braces you are currently in and I think the other lets you highlight the current line
ReSharper is nice, but if you're also looking for something for all kinds of languages, there is Visual Assist X, which also does nice highlighting.
It, too, has the option to highlight matching braces in your current block:
Then you have a line highlighter, either as a simple frame:
Or as a good looking background:
Sadly, there is no option in it to enable a real "block" highlighting like hovering over the [-] button does. :| I also looked for, but didn't find such an option within the Visual Studio options.
Highlight everything you want your eyes to focus on and press ctrl+H.
Or, highlight everything you DON"T want and right click "Outlining" then select "Hide Selection." The short cut for that is ctrl+M
This can be done using bookmarks. The out-of-the-box configuration of bookmarks does not highlight, however this can be changed easily:
Go to Tools – Options – Environment – Fonts and Colors. Under Display Items, select Bookmark. Now change the background color to something, like red. Then go to Tools – Options – Text Editor – General and uncheck Indicator Margin.
PS Bookmarks can be found in the Text Editor toolbar
PS2: To quickly set bookmarks use Ctrl+k+k, but beware of Ctrl+k+l which will wipe out all your bookmarks, it happened to me once!
Adapted from: http://blogs.msdn.com/b/saraford/archive/2007/09/05/did-you-know-how-to-change-a-bookmark-color.aspx
I've just recently started using VS2008 for a new tools project, and have been spending a lot of time in Eclipse/Java. The one thing I am missing is the thing I could have sworn was in VS2005 the last time I worked with it - the class outline.
I'm speaking of the basic outline in Eclipse, where you can see the class members, methods, etc and click on them to navigate to them.
The only thing that sounds like it might be it (but is not) is the Class View.
Any help?
This is probably the closest addin that you'll find that has it:
Source Code Outliner Power Toy
(The window on the left is what it adds to Visual Studio)
alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SourceCodeOutliner&DownloadId=3493
"You can dock the Source Code Outliner anywhere, like to the left side of the Visual Studio window next to the Code Editor window."
"Click a method or variable name in Source Outliner and the code associated with what you clicked displays near the top of the Code Editor window."
JetBrains Reshaper.
This is what I had to do:
Open the Object Browser (View->Object Browser). It will open as a tab.
Right click the tab and select the "dockable" option. Then it will open as a window floating around.
I have 2 monitors, so in one of them I have visual studio, and in the other I put the Object Browser window. If you click something in the Object Browser, it will take you to where it is defined in the visual studio editor.
Not the same as the Eclipse outline (I miss it too), but this is the closest to it I'have found without adding pluggins.
Try this menu option:
View > Class View
The default keyboard shortcut is
Control + Shift + C