Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable error squiggles in visual studio code

I am using Visual Studio Code to program in C++ but it keeps giving me error squiggles. I tried disabling them in the settings by changing C_Cpp error squiggles to disabled but they still appear. Is there anything else I need to do to disable them as I find them very annoying?

like image 435
Tori Harris Avatar asked Oct 10 '18 10:10

Tori Harris


People also ask

How do I get rid of error squiggles in VS Code?

You can open the settings. json file with the Preferences: Open Settings (JSON) command in the Command Palette (Ctrl+Shift+P). Once the file is open in an editor, delete everything between the two curly braces {} , save the file, and VS Code will go back to using the default values.

How do I turn off autocompletion in VS Code?

By default, VS Code shows snippets and completion proposals in one widget. You can control the behavior with the editor.snippetSuggestions setting. To remove snippets from the suggestions widget, set the value to "none" .


2 Answers

The straightforward thing works

What you said you did works for me in VSCode 1.37.1.

Before, with defaults:

Screenshot of error with squiggle

Changing the setting:

Screenshot of changing the setting

After:

Screenshot of error with no squiggle

Excerpt of settings.json:

{
    ....
    "C_Cpp.errorSquiggles": "Disabled"
}

Hypotheses about why it did not work for you

There is another settings.json attribute called C_Cpp.default.enableConfigurationSquiggles. Might you have accidentally changed that one?

Is "C_Cpp: Intelli Sense Engine" set to "Default"? It should be (rather than "Tag Parser") in order to disable squiggles.

Maybe the syntax error you have is different somehow?

For ease of reproduction, it would help to see your settings.json, c_cpp_properties.json, and an example of erroneous syntax with squiggles.

like image 98
Scott McPeak Avatar answered Sep 20 '22 16:09

Scott McPeak


If you are looking for a language agnostic solution, you can make the squiggly lines transparent by adding following setting to in settings file. As far as I know, there is no settings to turn the error decorations off.

"workbench.colorCustomizations": {
  //                                ↓↓
  "editorError.foreground": "#00000000"
}

For a specific language:

"workbench.colorCustomizations": {
  "[jsonc]": {
    //                                ↓↓
    "editorError.foreground": "#00000000"
  }
}

Please note that we use 8-digit hex value, the first six is not important but last two should be zero to make the color transparent.

Here is how you can do it programmatically in an extension:

workspace.getConfiguration('workbench').update( 'colorCustomizations', {
    "editorError.foreground": "#00000000",
});
like image 23
snnsnn Avatar answered Sep 23 '22 16:09

snnsnn