How do i stop full line highlight in vs code versions control? - visual-studio-code

Is there any way to stop the full line highlight in versions control?
It is very confusing when the vscode is highlighting the full line and not only the changed piece of code especially when there is a lot of changes.
vscode vs sublime merge line highlight

Some related issues: https://github.com/microsoft/vscode/issues/116413
https://github.com/microsoft/vscode/issues/103207
https://github.com/microsoft/vscode/issues/66223
Upvote these - especially the first which is in the candidate phase.
You can play around with these colorCustomizations in your settings.jsonwhich might help a "little":
{
"workbench.colorCustomizations": {
"diffEditor.insertedTextBorder": "#0f0",
"diffEditor.insertedTextBackground": "#0000", // set to transparent
"diffEditor.removedTextBackground": "#0000", // set to transparent
"diffEditor.removedTextBorder": "#f00"
}
But these changes don't help much in my opinion. Upvoting is probably your best bet.

Related

How to highlight current line number in Visual Studio Code / VS Code

I am in the process of migrating from Atom to VS Code, as it seems to be what all the cool kids use these days.
In atom I was able to highlight the current line number as pictured (the blue highlight in the gutter).
Is there a way to do this in VS Code? With a setting or extension? Can't find a way to do it, and really missing that obvious at-a-glance indication of where I'm working.
(I know that I can add a background to the current line itself, but this is too intrusive to the code, especially working with a variety of languages in different colours.)
Thanks!
You could try
"editor.renderLineHighlight": "gutter"
UPDATE
In an ideal world I'd want both the gutter and the line itself highlighted, but in 2 very different colours - sadly that one doesn't seem possible, but this option is better than nothing!
Well, you may try something like settings below, liner number in different color as well as box for the line
"editor.renderLineHighlight": "all",
"workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#00000000",
"editor.lineHighlightBorder": "#0000ff"
}
To address dark and light themes
In the settings.json file add something like:
"workbench.colorCustomizations": {
"[Default Dark+]": {
"editor.lineHighlightBackground": "#00000071",
},
"[Default Light+]": {
"editor.lineHighlightBackground": "#0000003f",
}
},

Can I get character highlighting in VS Code difftool mode?

When VS Code is used as a diff tool, e.g. with git difftool, it shows changed lines in red and green. Is there a way to highlight the changed characters (in addition to or instead of the lines) so that they stand out more?
VS Code git diff actually does have character highlighting. It's just very subtle, so it may not be noticeable.
You can modify the diff color settings to find one that allows for more contrast. Make sure the color specifies the alpha channel, otherwise it won't work.
settings.json
"workbench.colorCustomizations": {
"diffEditor.insertedTextBackground": "#00bb0044",
"diffEditor.removedTextBackground": "#ff000044",
},
For more info, see How to change diff color Visual Studio Code

Change background of selected block

When I place my cursor on the extremity of a block (represented by the white drawn cursor on the picture below) VSC highlight both the ending and the starting symbol of that block.
The red line on the picture represent the starting and the ending of that block. Where can I set the option for VSC to automatically use a background color to highlight the current selected block ? (I am really more of a visual guy and I like to feel where's my current locations when I am coding.)
You are going to need an extension to do that, it isn't built-in. Try:
Indented Block Highlighting
I am not sure it supports all languages but see if it works in your case.
Bracket-pair-colorizer does something similar but more subtle. See "bracket-pair-colorizer-2.showHorizontalScopeLine".
.
And see How to change indent guide line color between brackets in VSCODE? - perhaps highlighting the active indent guide will be enough for you?
Using (in your settings.json):
"workbench.colorCustomizations": {
"editorIndentGuide.background": "#bbb",
"editorIndentGuide.activeBackground": "#f00e0e",\
}

How to disable error squiggles in visual studio code

I am using Visual Studio Code to program in C++ but it keeps giving me error squiggles. I tried disabling them in the settings by changing C_Cpp error squiggles to disabled but they still appear. Is there anything else I need to do to disable them as I find them very annoying?
The straightforward thing works
What you said you did works for me in VSCode 1.37.1.
Before, with defaults:
Changing the setting:
After:
Excerpt of settings.json:
{
....
"C_Cpp.errorSquiggles": "Disabled"
}
Hypotheses about why it did not work for you
There is another settings.json attribute called C_Cpp.default.enableConfigurationSquiggles. Might you have accidentally changed that one?
Is "C_Cpp: Intelli Sense Engine" set to "Default"? It should be (rather than "Tag Parser") in order to disable squiggles.
Maybe the syntax error you have is different somehow?
For ease of reproduction, it would help to see your settings.json, c_cpp_properties.json, and an example of erroneous syntax with squiggles.
Currently, there is no settings to turn the error decorations off but some language extensions implement their own solutions.
If you are looking for a language agnostic solution, you can make the squiggly lines transparent by adding following setting to general settings or workspace settings file.
"workbench.colorCustomizations": {
// ↓↓
"editorError.foreground": "#00000000"
}
For a specific language:
"workbench.colorCustomizations": {
"[jsonc]": {
// ↓↓
"editorError.foreground": "#00000000"
}
}
Please note that we use 8-digit hex value, the first six is not important but last two should be zero to make the color transparent.
Here is how you can do it programmatically in an extension:
workspace.getConfiguration('workbench').update( 'colorCustomizations', {
"editorError.foreground": "#00000000",
});
just go to command palette (ctrl + shift + P) and then search C/C++ enable error squiggles and select that. Done

Unit Testing in iOS 5: Is there a way to remove STAssertTrue() lines from the editor temporarily?

I find writing hundreds of STAssertTrue lines inbetween my code hurts readability a lot. Is there a way to remove these lines temporarily from the editor window so I don't see them?
I don't think there is. But sometimes good features are hidden...
Not exactly, but if you change
code
STAssert...
STAssert...
STAssert...
more code
to:
code
{
STAssert...
STAssert...
STAssert...
}
more code
You could collapse braced part to {...} by clicking on the disclosure triangle to the immediate left of the text editing area.