Error squiggles in VS Code are controlled by the C_Cpp setting and require the Microsoft C/C++ extension to be installed and configured correctly.
Opening a C or C++ file in VS Code expecting red underlines and seeing nothing but clean white text is a jarring moment. The fix is straightforward but depends on knowing where the setting lives, which extension owns it, and why one toggle can silently override another. Error squiggles—the red or green wavy lines under syntax errors—are handled by the C/C++ extension’s language server. They are enabled by default as EnabledIfIncludesResolve, meaning they appear when the extension can resolve your include files. When they are missing, the cause is almost always one of four things: the extension isn’t installed, the setting got flipped to Disabled in the Workspace scope, the folder wasn’t opened properly, or the workspace isn’t trusted.
What Are Error Squiggles in VS Code?
Error squiggles are the colored underlines VS Code draws beneath code that has a syntax error, type mismatch, or unresolved include. Red squiggles mark errors, green marks warnings, and blue marks hints. They come from the language server attached to your file type. For C and C++, that server lives inside the Microsoft C/C++ extension—the one with 84 million downloads published by Microsoft itself. Without that extension installed, the C_Cpp setting simply does not exist, and no squiggles can appear for those languages.
Turning On Error Squiggles: The Setting Path That Works
Enabling error squiggles requires opening VS Code’s settings, finding the correct option, and making sure it is applied in both the User and Workspace scopes. Here is the exact sequence that works every time.
Step 1: Install the Microsoft C/C++ Extension
If the extension is not already installed, nothing else matters. Open the Extensions view by pressing Ctrl + Shift + X (or Cmd + Shift + X on macOS), search for “C/C++,” and install the one published by Microsoft with the 84M+ download count. After installation, VS Code may prompt you to reload the window.
Step 2: Open Settings
Press Ctrl + , (Windows/Linux) or Cmd + , (macOS). The alternative path is File > Preferences > Settings.
Step 3: Search and Configure the Setting
In the Settings search bar, type error squiggles. The relevant entry is C_Cpp: Error Squiggles. Click the dropdown and select Enabled or EnabledIfIncludesResolve.
Step 4: Verify Both Scopes
This step catches the most common failure. The User and Workspace scopes appear as two tabs inside the Settings page. If the Workspace tab shows a different value than the User tab, the Workspace value wins. Make sure both are set to Enabled or EnabledIfIncludesResolve. If you see “Modified on Workspace,” click that warning to enable it there too.
Step 5: Use the JSON Override (if the GUI Fails)
If the dropdown refuses to stick, press Ctrl + Shift + P (or Cmd + Shift + P on macOS), type settings.json, and select Preferences: Open User Settings (JSON). Find the line "C_Cpp.errorSquiggles": "Disabled" and change it to "C_Cpp.errorSquiggles": "Enabled". Save the file and the underlines should appear immediately.
| Setting Option | Behavior | Best For |
|---|---|---|
| Enabled | Shows squiggles on all detected issues regardless of include resolution | Users who want immediate feedback on every syntax problem |
| EnabledIfIncludesResolve | Shows squiggles only when the extension can resolve your include files | Default behavior; works well for most projects with proper paths |
| Disabled | Hides all error squiggles for C/C++ | Only useful when diagnostics are handled by a different tool |
Why Aren’t My Error Squiggles Showing?
When the setting is correct but squiggles still refuse to appear, the problem is almost always outside the setting itself. The five causes below account for nearly every case, and each has a fast fix.
Mixed scope override. The Workspace scope silently beats the User scope. Open both tabs in Settings and set both to Enabled. This single issue causes more missing squiggles than any other.
Single file opened instead of a folder. Opening a single .c or .cpp file directly (via File > Open File) prevents the C/C++ language server from initializing fully. Use File > Open Folder and point it at your project directory instead.
Workspace Restricted Mode. If VS Code displays “Restricted Mode” in the status bar, the workspace is not trusted, and the extension will not run diagnostics. Click Trust in the status bar to allow the language server to activate.
Extension conflict. Some extensions—older C# tools, Dark Reader, or custom linters—can suppress diagnostic underlines. Use the Extension Bisect tool in VS Code to find the conflict by disabling extensions one by one.
Corrupted language server index. The C/C++ extension can accumulate a bad index over time. Reload the window (Ctrl + Shift + P, then Developer: Reload Window) or uninstall and reinstall the extension to force a fresh index.
| Issue | Likely Cause | Fast Fix |
|---|---|---|
| No squiggles despite setting enabled | Workspace scope overrode User scope | Set both scopes to Enabled |
| Squiggles worked before, now gone | Corrupted index or extension update | Reload window or reinstall extension |
| Squiggles appear for some files but not others | Include paths not resolved | Switch to Enabled mode, not EnabledIfIncludesResolve |
| “Trust” prompt in status bar | Restricted Mode active | Click Trust in the status bar |
| No squiggles in new project | Single file opened instead of folder | Use File > Open Folder |
Does This Work for Other Languages?
The C_Cpp: Error Squiggles setting is specific to C and C++ files only. Python, JavaScript, TypeScript, Rust, and Go each have their own language servers with independent diagnostics settings. For Python, ensure the Pylance extension is installed and the python.languageServer setting is set to Pylance. For JavaScript and TypeScript, diagnostics come from the built-in TypeScript server—no separate extension is needed. The principles are the same: check that the relevant language server is installed, enabled, and configured, and that the workspace is opened as a folder.
Getting Squiggles Working: The Full Checklist
When error squiggles go missing, work through this list in order, and they will reappear. The official guide on the C_Cpp error squiggles setting confirms each of these steps.
Check the extension first—Microsoft C/C++ must be installed. Verify the setting next: C_Cpp: Error Squiggles set to Enabled or EnabledIfIncludesResolve in both the User and Workspace scopes. Open your project as a folder, not a single file. Trust the workspace if Restricted Mode is active. If squiggles still hide, switch to JSON settings and force the value manually. Between the GUI path, the JSON override, and the folder-vs-file distinction, every cause has a match.
References & Sources
- Khadija Tech Talk. “How to Enable Error Squiggles in VS Code” Primary guide covering the settings path and default values.
