microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.15k stars 28.53k forks source link

Portion of file where deleted lines show as red #161386

Closed anuj98 closed 1 year ago

anuj98 commented 1 year ago

Type: Bug

In normal file and not in git compare, whenever a line is deleted it shows as red color in the right section. It causes confusion as the this color matches with the color whenver there is an error in code.

image

VS Code version: Code 1.71.0 (784b0177c56c607789f9638da7b6bf3230d47a8c, 2022-09-01T07:36:10.600Z) OS version: Windows_NT x64 10.0.22000 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |Screen Reader|no| |VM|0%|
Extensions (13) Extension|Author (truncated)|Version ---|---|--- atlascode|atl|2.10.12 emoji-snippets|dev|1.5.3 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|12.2.2 prettier-vscode|esb|9.8.0 auto-close-tag|for|0.5.14 auto-rename-tag|for|0.1.10 vscode-azureappservice|ms-|0.24.3 vscode-azureresourcegroups|ms-|0.5.6 azure-account|ms-|0.11.1 cpptools|ms-|1.12.4 vscode-yaml|red|1.10.1 html5-boilerplate|sid|1.1.1
VSCodeTriageBot commented 1 year ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.71.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

anuj98 commented 1 year ago

This is the latest updated version still seeing the same issue

anuj98 commented 1 year ago

Which colour are we thinking of here? And what might be the expected ETA?

lszomoru commented 1 year ago

Any thoughts on this @daviddossett, @alexdima?

daviddossett commented 1 year ago

I think it makes sense to use the same color we use for diffs—green for inserted, red for deleted. Not to discount the issue, but I think that benefit outweighs the overlap with errors IMO. It would be strange to use a different color in the editor.

We could possible use a pattern or shape (like a mini version of the line deleted arrow) in the minimap to distinguish it from errors. @lszomoru is it even possible do customize anything beyond the color in the minimap?

lszomoru commented 1 year ago

We could possible use a pattern or shape (like a mini version of the line deleted arrow) in the minimap to distinguish it from errors. @lszomoru is it even possible do customize anything beyond the color in the minimap?

I would have to defer to @alexdima on that.

alexdima commented 1 year ago

Currently only the color can be changed in the minimap gutter decoration rendering

daviddossett commented 1 year ago

I looked into this and it appears that we represent deleted lines in the gutter and errors inline with the line/word(s) highlighted.

CleanShot 2022-10-18 at 10 12 06@2x

I believe this is the right thing to do since it essentially matches what we do in the editor.

CleanShot 2022-10-18 at 10 11 52@2x

Changing the color to be different in the minimap will likely cause more confusion. What did you have in mind, @anuj98?

@alexdima I was going to suggest to override the colors in settings.json but I can't seem to get this to work. Similarly, I can't override the base color editor.errorForeground.

"workbench.colorCustomizations": {
  "editor.minimapGutter.deletedBackground": "#FF53CF",
}

Any ideas why this only works when changing the inherited color value here?

https://github.com/microsoft/vscode/blob/3747d2224ccfc88e76df3436c511f9bfffc77a7d/src/vs/platform/theme/common/colorRegistry.ts#L289

alexdima commented 1 year ago

@daviddossett The following worked for me:

"workbench.colorCustomizations": {
    "editorGutter.deletedBackground": "#0000fb",
    "minimapGutter.deletedBackground": "#0000fb",
    "editorError.foreground": "#00ff11",
    "minimap.errorHighlight": "#00ff11",
    "editorOverviewRuler.errorForeground": "#00ff11"
}
Screenshot 2022-10-23 at 18 40 04
daviddossett commented 1 year ago

Ah ok I think my mistake was using "editor.minimapGutter.deletedBackground" instead of "minimapGutter.deletedBackground". Seems to work for me now.

lszomoru commented 1 year ago

@daviddossett, what is the status of this issue? Thank you!

daviddossett commented 1 year ago

I'd suggest we close this issue given the findings above.