Repository: vscode
Issue: Gathering feedback from Diagnostics
Labels: feature-request,languages-diagnostics

# Diagnostics in VScode

At the moment for the Diagnostics, its hard to measure usefulness. Its possible to proxy the *usefulness* by seeing diagnostics with quick fixes have fixes applied (being a strong Useful signal), but this leaves out the Diagnostics that don't have any quick fixes (can be at best proxied via tracking the diagnostic disappearing after hover, which is not a direct signal of being useful), and not having quick fix applied is not a 100% signal of not usefullness either (as that may still mean that there is some issue with the fix, e.g. it not being correct, or not covering all cases).

That being said, I propose that a feedback interaction would be added to a Diagnostic Hover, allowing the users to provide an explicit signal about usefulness/nonUsefulness.

For example see the image below.
![image](https://user-images.githubusercontent.com/13024177/218781918-d4c0f019-cf2f-492d-9107-a6933ab4c779.png)

I am happy to contribute this feature.

## UX details to consider

Since there can be multiple diagnostics on the same line, and on hover they would be displayed in the same hover card, the most reasonable space to contain this feedback would be in in the body of the Hover card, on the row of the diagnostic.

The placement in the row should be at the bottom, with a message such as *"Was this useful/helpful"* . The bottom of the row makes sense as placing it at the top feels a bit intrusive and places the features interest instead of the user.
Although placing at the top would makes sense, since through our studies we see that users are more likely to provide negative info than positive, and obviously wrong diagnostics which are longer would require scrolling to allow to provide this info, we plan to gather more data to see if this placement would be even neccessary.

After a feedback is submitted for a diagnostic, the state is stored in workspace cache by ID created from Diagnostic data so that clones, and subsequent hovers on the same diagnostic show that the user already provided some sort of feedback. 
The ID can be generated by hashing filePath/message/code under diagnostic/owner  to ensure that movement of diagnostic through file won't change the ID.

**NotUseful** triggers should remove the Label "Was this helpful", and in place create additional actions, such as "file a bug" to be able to trigger this actions, in the source of feedback creation. (On pressing the file a bug, vscode feedback should be opened)

Also the separator used for the hoverRows is barely visible in some themes, if there are multiple diagnostics. The contrast could be increased to make it visible where the feedback action is attached

### Optional next steps

Filled Icons could be used for the buttons, once clicked, to signal the state.

The diagnostics that were marked as **NotUseful** can be automatically filtered from the editor to declutter the screen.

Additionally, since the **NotUseful** feedback might become intertwined with diagnostics that are not useful because there are too many of them displayed at one time, an action could be provided on an interaction allowing to disable the `provider`-`source`. This would should then set a setting in the User settings (e.g. "Diagnostics -> Lint -> Disable") to true, allowing the user to revert.