vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Offer code mark styles and gutter marks

Open dbaeumer opened this issue 10 years ago • 49 comments

From @darkred on July 10, 2016 23:30

(Using VSCode 1.3.0 in win 10 x64 build 10586 with vscode-eslint extension 1.10.18).

Currently the code marks(for errors and warnings) appear only as squiggly underline (i.e. as spellchecker errors in browsers, e.g. Firefox, Chrome): (the error is in red, and the warning is in green) 2016-07-11_020259

My suggestion is to offer more code mark styles (ideally the outline style, as it highlights the errors/warnings the best way -see below- ) and gutter marks : (with the errors to be in red, and the warnings to be in yellow, as ESLint itself uses these colors - not green) 2016-07-11_020203 (here is another screenshot)

It's more easy to distinguish the errors this way.

Thank you


For reference SublimeLinter3 package offers five different code mark styles :

  • fill,
  • outline (the default style),
  • solid underline,
  • squiggly underline, and
  • stippled underline

and two types of gutter marks:

  • errors, and
  • warnings

Copied from original issue: Microsoft/vscode-eslint#99

dbaeumer avatar Jul 13 '16 13:07 dbaeumer

From @AndrewIngram on July 11, 2016 9:15

I found myself searching around for a setting to enable this, I guess i've been heavily spoiled by Atom and Sublime. This is pretty important for me, because I find the squiggly lines to be far too difficult to see when scrolling through a file.

dbaeumer avatar Jul 13 '16 13:07 dbaeumer

From @glebec on July 11, 2016 18:28

I second the use of yellow for warning. For one thing, red-green is always a poor UI choice as it ignores the 7%+ of XY-chromosomal people who have red-green color blindness. For another, it matches ESLint. Also yellow just feels more like a warning than green, culturally speaking.

Also, the gutter marks can be very helpful, though in the case of VSC it might require some different style as VSC's breakpoint markers are very similar to SublimeLinter error marks.

dbaeumer avatar Jul 13 '16 13:07 dbaeumer

Moving to vscode since such a feature has to be implemented in the editor.

dbaeumer avatar Jul 13 '16 13:07 dbaeumer

@egamma @bpasero I also like the suggestion of using yellow for warning instead of green. Green in dark themes is very hard to read.

dbaeumer avatar Jul 13 '16 13:07 dbaeumer

I think we only use green because VS does? Not sure...

bpasero avatar Jul 13 '16 13:07 bpasero

I've noticed that Visual Studio show errors as squiggly underline as well. So, this style was picked for consistency with VS. But, honestly, showing errors/warnings as squiggly underline is very difficult to distinguish when scrolling through a file (often I have a hard time locating them, especially when the error is a single character, eg. a quote ' or a bracket } or $ ), plus, that this kind of style suggests more to that is a spellcheck error. e.g.. in the screenshot: both while (error) and console (warning) seem to be just typos, misspelled words - not the result of static analysis.

The best would be the user to be able to choose the style he prefers. (IMHO the 'outline' style highlights the errors/warnings perfectly).

darkred avatar Jul 13 '16 18:07 darkred

The best would be the user to be able to choose the style he prefers.

Agreed — I, for example, have a different preference from you in that I like "squiggly" over "outline."

glebec avatar Jul 13 '16 18:07 glebec

@bpasero yes green was picked for consistency with VS. Need to check what VS does in the dark theme @bgashler1 ?

egamma avatar Jul 14 '16 09:07 egamma

I believe VS uses a more vibrant green:

image

stevencl avatar Jul 27 '16 13:07 stevencl

For me it is not only readability. Green conveys the wrong information as well. And the warning icon is usually a yellow triangle with an exclamation mark. So yellow would be IMO the better color for this even if VS uses a more vibrant green.

dbaeumer avatar Aug 04 '16 10:08 dbaeumer

I contacted the VS team to learn more about the reason for choosing green. Originally it was yellow (VS2003 I think) but not many people could recall why it was changed. The general consensus though was that it was probably because of the poor contrast that yellow has on a light background.

Yellow definitely makes more sense but we will need to see if we can come up with a colour that looks right and has appropriate contrast in the light theme. @bgashler1 - can you help choose an appropriate colour?

stevencl avatar Aug 04 '16 21:08 stevencl

@stevencl is there any specific reason we cannot do as @darkred suggests and let warning & error colors be user-defined, or even theme-defined?

glebec avatar Aug 04 '16 23:08 glebec

(This comment is regarding only the color, not the styles...)

A while ago, Microsoft Word set a precedent for using red squiggly lines for errors in spelling and green for warnings of possible grammar mistakes. This is likely why Visual Studio followed suite, because it was a pattern that people were familiar with in other software and the concepts were similar.

To make the software more inclusive for color blindness, recent versions of Word now use blue instead of green for warnings (see below).

capture

I propose we use blue here for warnings. I find blue to work well in both light and dark settings.

bgashler1 avatar Aug 05 '16 00:08 bgashler1

@glebec As far as whether we can do user-defined styles or theme-defined styles for errors and warning, I will put this on our UX sync agenda to get our team's feedback. Thanks for the great suggestion!

bgashler1 avatar Aug 05 '16 00:08 bgashler1

If the setting is added, it would be really nice for it to support the "stippled" / dotted underline, since that look is the native look for the spell checker on Mac OS X

In fact, it should probably be the default look on OS X, if no option is specified.

coreh avatar Aug 05 '16 05:08 coreh

I just switched from Atom to VS Code about a week ago. I have a short list of things that need to fixed. This issue is one of them. Arguing over which color is right or wrong will never solve the problem for everyone. Choose reasonable defaults as best you can (green seems weird). But allow the user to override the default styles. Additionally, optionally allowing corresponding error/warning glyphs in the gutter is a great idea. Also while I'm in rant mode, expressing the theme in XML is so old fashioned. I know it's a plist thing, but honestly, do you have to slavishly copy Apple even when it's wrong?

gold avatar Sep 30 '16 03:09 gold

For reference SublimeLinter3 package offers five different code mark styles :

fill, outline (the default style), solid underline, squiggly underline, and stippled underline

For me this is one of the main thing i miss in vscode. Here is the reference : https://sublimelinter.readthedocs.io/en/latest/mark_styles.html

It can be a good idea to consider to add another mark style like a "red color" for the text in error. That's the case in IntelliJ, as you can see in this video tutorial for typescript : https://youtu.be/n6RoVyZEsv4?t=13m20s capture d ecran 2016-10-24 a 15 47 48

Each time an error occurs, the text become red.

Does anyone can confirm me it's not possible yet ?

DavidBabel avatar Oct 24 '16 13:10 DavidBabel

+1 I would love to see a yellow/red mark in the gutter like in atom. The green squiggly underline is just hard to see and easy to miss. I need a way to customize this.

javiayala avatar Nov 03 '16 18:11 javiayala

Some outline actually exists in vscode atm. Like when you target a bracket and it highlight the corresponding one :

capture d ecran 2016-11-04 a 10 34 46

Don't know if it can be used elsewhere

DavidBabel avatar Nov 04 '16 09:11 DavidBabel

Could this issue be tackled in multiple steps to see faster progress? E.g. switch warning color from green to yellow (or blue?) in the first step. Than allow different error/warning highlights like dotted lines, gutter marks, outlines, etc.

donaldpipowitch avatar Jan 31 '17 08:01 donaldpipowitch