microsoft / vscode

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

Better highlighting on errors to spot them faster #16222

Closed rgolea closed 4 years ago

rgolea commented 7 years ago

Hi there!

I've been experiencing a problem when highlighting errors on VSCode. Whenever you have big issues you can spot them on the fly when opening the document. But if your issues are small, you need more time to spot those errors.

As you can see in the image below, these 2 lines have 2 errors and both of them have the problem of not having a semicolon at the end of the line: screen shot 2016-11-29 at 15 45 30

The first one is easier to spot than the second (at the end of the parenthesis). The simpler solution for this would be to highlight the entire line in some way (so double highlight) just to spot easily the lines that have errors.

Atom does this the following way: screen shot 2016-11-29 at 15 48 21

Thanks and keep up the good work!

hoovercj commented 7 years ago

One solution to this would be to expose diagnostics for a document through the api. This would allow extension developers to add custom decorations for diagnostics

rgolea commented 7 years ago

@hoovercj Sorry, how can I do that? Or is this for the dev team?

hoovercj commented 7 years ago

@rgolea it is a suggestion for the dev team. It would also allow extension developers to come up with a solution for this issue that I opened a year ago: https://github.com/Microsoft/vscode/issues/1688

alexdima commented 7 years ago

Errors and warnings can be seen through multiple views:

@bgashler1 Do you think we should do more with errors/warnings to make them stand out even more ?

rgolea commented 7 years ago

@alexandrudima the problems view is a good way to view all the errors, but a simple highlight should suffice to bother the user. For example, I am working with a team that isn't quite tidy with their code and the fact that it's highlighted is a good way to bother them and change it. If the errors are just in a simple palette or just underlining the errors, it is not really enough to make a team like that change the code. And I am sure all of us have someone in their team that does or did that.

Is there an update on this feature?

Thanks a lot guys!

ypresto commented 7 years ago

In dark theme, (green) warning shown via squiggles and overview ruler with scroll bar is looks like this:

2016-12-29 18 34 16

I think it is hard to see. >_<

(EDIT: Past almost 1 year, and I used to warning marker on right bar now. It might be better to increase contrast.)

Ciantic commented 7 years ago

Here is a great StackOverflow that illustrates this: https://stackoverflow.com/questions/38057227/is-there-a-way-to-improve-linting-errors-highlight-in-visual-studio-code

Spot the errors! I literally spend several minutes my workday searching for these little squiggles, the Atom has figured this out.

Image from the stack overflow question: image

P.S. let me elaborate a bit, the main problem comes from this: You are seeing error in the scrollbar, but can't find it. I know I could go and browse the problems view, but then I should navigate to the exact position again from the list view.

pr-yemibedu commented 7 years ago

Hello, I don't really think many people dislike the help the editor gives, they just don't want to be limited that it is the only true way to convey information to the user. If the information is presented as a pub/sub list, then any tool, including the existing problems view can take the information and present innovative visuals to cater to user needs. For example, being able to make it friendly for audio tools or to present statistics like code complexity and to maybe give better context like file type aware containment (functions or module name) and more levels of concern like ignorable or bad style. Thank you. Good day.

steveostudios commented 7 years ago

+1 I think this feature would be fantastic! In Atom having a dot on the left is way more helpful. My eye is constantly looking at the beginning of a line when reading code. Rarely ever do I look over to the purposefully look at the right side of my screen.

distantnative commented 7 years ago

+1

Valid commented 7 years ago

+1. I'd prefer a gutter icon like the Atom example above or how ST handles it, but the squiggly just doesn't cut it for me.

hoovercj commented 7 years ago

I still advocate for exposing a list of all problems in a workspace via the API, both a getDiagnostics function and a onDiagnosticsChanged event.

simonvomeyser commented 6 years ago

+1 Would also love a gutter icon to spot errors more quickly!

bardware commented 6 years ago

Eclipse has these markers on the left hand side. One distinct icon for information, one for warning and one for error

walt-er commented 6 years ago

+1 This would be a massive help, please add! Both the option to change the highlight/underline style and, more importantly, gutter icons!

sgmonda commented 6 years ago

+1

GriffinSauce commented 6 years ago

I'd like to add an accessibility perspective: I am colourblind (red-green, so I see colours but red and green do not pop out like you would expect) and the squiggly line is so thin that I can't make it stand out unless I make it white for max contrast. This is especially true for single character syntax errors.

These solutions would definitely work:

Just speaking from my own perspective, but solutions for colourblind also improve the situation for the visually impaired (or people with regular aging eyesight ;) )

ssrballin commented 6 years ago

+1

balabukha commented 6 years ago

It'd be great if you add some additional dots into code. +1

brettshumaker commented 6 years ago

It'd be great to be able to style the errors generated by specific extensions - i.e. making a phpcs extension error look different than one generated by the PHP Intelephense extension.

My specific use case is when dealing with legacy code (or code where I don't control the coding standards) that triggers loads of phpcs errors and warnings, it's nearly impossible to use the Problems tab. Of course I can filter for the extension I really want to see problems for, but there should be a way for users to visually distinguish problems by extension, that data is obviously available.

Note: I think this is relevant to this issue, but I'd be happy to create my own for this feature request.

pr-yemibedu commented 6 years ago

Hello, @brettshumaker that is a helpful idea.

It seems interesting to have a useful version of this that would also help to know if an extension is even working or if it is being supplanted or usurped. Thank you. Good day.

Marcelo-Petrucelli commented 6 years ago

+1

Visualization is a key feature when dealing with errors and large codes. ^_^

DanTup commented 6 years ago

(FWIW, diagnostics are exposed via an API now, so it may be possible to build this as an extension?)

https://code.visualstudio.com/docs/extensionAPI/vscode-api#languages.getDiagnostics

chrisgreeffpp commented 5 years ago

+1

greevz commented 5 years ago

+1

mavuio commented 5 years ago

+1

usernamehw commented 5 years ago

https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens

Screenshot (11)

https://marketplace.visualstudio.com/items?itemName=JoeBerria.statusbarerror

statusbarerror

isidorn commented 5 years ago

For now are happy with how the usernamehw.errorlens does this. So we recommend users download this extension and try it out. We will probably not change this in vscode core yet.

isidorn commented 4 years ago

Closing this as we will not make changes in vscode core, and extensions can tackle this properly on their end.

luckylooke commented 4 years ago

Sometimes it is very hard to spot error in Monokai theme and typescript. Imho should be better highlighted by default, not by extensions. Screenshot at Aug 20 06-57-25