Sabbir Ahmed
Sabbir Ahmed

Reputation: 1704

VSCode syntax error highlighting is not working for C++ code

The C/C++ extension by Microsoft has been installed, and everything works really well. But the VSCode does not seem to show any red underline for syntax errors when there are issues.

I'm using Linux (kubuntu) with the pre-installed g++. I can also successfully build my code and run it.

Any suggestions on how to fix this problem?

Upvotes: 8

Views: 15220

Answers (3)

Rohan Bari
Rohan Bari

Reputation: 7726

After reading the comment on the previous answer, it seems like something is wrong with your settings. One final way to fix this issue is to reset the settings of VS Code to its factory defaults.

Delete the following files:

  • For Windows: %APPDATA%\Code\User\settings.json
  • For Linux: $HOME/.config/Code/User/settings.json

Or, do it directly from Code:

  1. Press F1 Type user settings
  2. Press Enter Click the sheet icon
  3. You will be redirected to the settings.json file.
  4. Delete all of its content, save and restart.

Disclaimer: This is only a workaround. It would be best if you tried to see which setting is likely causing the bug.

Upvotes: 10

thilak_reddy
thilak_reddy

Reputation: 1

  1. Go to settings in VS Code
  2. Search for squiggles
  3. Change c_cpp: Error Squiggles to enalbleifIncludesResolve

Upvotes: -2

Ahmed Ebrahime
Ahmed Ebrahime

Reputation: 49

In settings.json:

"C_Cpp.errorSquiggles": "Enabled"

from setting.json  "C_Cpp.errorSquiggles": "Enabled",

Upvotes: 4

Related Questions