Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide the ability to disable warning/error squiggles #194392

Closed
osaxma opened this issue Sep 28, 2023 · 10 comments
Closed

Provide the ability to disable warning/error squiggles #194392

osaxma opened this issue Sep 28, 2023 · 10 comments
Assignees
Labels
feature-request Request for new features or functionality

Comments

@osaxma
Copy link

osaxma commented Sep 28, 2023

While warning squiggles are useful, sometimes they just get in the way when the code is being heavily edited, and the process of writing code becomes quite distracting with squiggles appearing and disappearing as one types.

I would like to be able to disable/enable warnings/errors of the Analysis Server using the command palette with such commands:

  • Enable/Disable warning squiggles
  • Enable/Disable error squiggles

I think it's useful to disable each level separately since errors are much useful type of a feedback than warnings (especially with pedantic lints used by some projects).

Additional Context:
The feature is already part of C/C++ extension by Microsoft but it would be nice to have it as an Editor Feature instead of language server feature so it'll be available for all languages:

Screen Shot 2023-09-28 at 12 26 09 PM

Screen Shot 2023-09-28 at 12 19 21 PM
@TylerLeonhardt
Copy link
Member

Couple things...

You can disable the light bulb with: "editor.lightbulb.enabled": false

For the squiggles you can make them transparent with (in this case the errors):

"workbench.colorCustomizations": {
    "editorError.border": "#00000000",
    "editorError.foreground": "#00000000",
}

@osaxma
Copy link
Author

osaxma commented Sep 30, 2023

Hi @TylerLeonhardt

Sorry maybe I wasn't clear. I was mainly suggesting to have an easy way to toggle the warnings between on/off (mainly as a way to avoid warnings while typing)

The screenshots were for an example from the C++/C extension where this feature is available for errors, so the request is to have a similar switch for all languages to easily toggle warnings/errors on and off (preferably, a separate toggle for warnings and another for errors)

@usernamehw
Copy link
Contributor

Yes, "colorCustomizations" is the hack how to do it now: https://stackoverflow.com/questions/43454967/disable-wavy-underline-in-vs-code (to a question with 120k views)

Is it the best way to do it? No.

  1. Can you easily find it in settings UI? No.
  2. Do many people know about transparent color? Probably not.
  3. Is this
"workbench.colorCustomizations": {
	"editorError.background": "#ffffff00",
	"editorError.border": "#ffffff00",
	"editorError.foreground": "#ffffff00",
	"editorWarning.background": "#ffffff00",
	"editorWarning.border": "#ffffff00",
	"editorWarning.foreground": "#ffffff00",
}

easier to change than a single boolean setting, something like this

"editor.problemHighlight": false,// add squiggles/wavy/border keywords to settings description

No.

  1. There are also extensions that can toggle simple settings, like usernamehw.commands but they usually cannot toggle nested ones. And writing with vscode api into "workbench.colorCustomizations" will delete all the comments inside of it.

@DanTup
Copy link
Contributor

DanTup commented Oct 2, 2023

Slightly related - I've had a request a few times to have error squiggles just debounced until you stop typing for a while. While it's possibly to try and handle this in each languages language server, it seems silly to do it there rather than VS Code when the same complaint (it's distracting for squiggles while I'm typing - of course the code is invalid while I'm typing) exists for all languages (including TypeScript) :-)

@usernamehw
Copy link
Contributor

usernamehw commented Oct 2, 2023

I've actually filed that request in 2018 💀 #63737 Configurable delay for problem diagnostics. The response - every extension should handle it by itself.

@justschen justschen added the feature-request Request for new features or functionality label Oct 2, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone Oct 2, 2023
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@starball5
Copy link

Is this not a dup of #166797?

@justschen
Copy link
Contributor

closing as duplicate - main issue tracked in comment above

@justschen
Copy link
Contributor

@osaxma , this feature was recently added as a preview/experimental feature, which is subject to re-haul/change. Please check out problems.visibility to toggle visible problems in the editor, and check out the release notes for additional details on how the setting works at the moment. thanks :D

@osaxma
Copy link
Author

osaxma commented Dec 19, 2023

Hi @justschen

Thank you for the follow up and implementation 🙏🏽.. It's working as desired.

Will toggling the visibility be available in the command palette once it is officially released?

@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

7 participants