salbeira
salbeira

Reputation: 2583

Visual Studio Code Intellisense Mode

What are valid values for the c_cpp_properties.json tag "intelliSenseMode" ?

It defaults to clang-x64, but I am compiling with g++ so is there another value I can use there? I can not find any documentation about it.

Upvotes: 13

Views: 46725

Answers (6)

Fábio Lobão
Fábio Lobão

Reputation: 301

When editing the .json configuration file, just type "intelliSenseMode": "" and let intelliSense itself help.

Actually you may use the option "intelliSenseMode": "${default}" to allow self selection.

Upvotes: 8

Dhwani Katagade
Dhwani Katagade

Reputation: 1240

Hovering on the intelliSenseMode in the file c_cpp_properties.json shows this documentation popup.

screenshot of popup on intelliSenseMode

It pretty much says that valid values have to be specified in the format <platform>-<compiler>-<architecture>. The older <compiler>-<architecture> variants are legacy modes and are converted automatically to the newer format based on the platform. So, some valid values can be

  1. linux-gcc-x64
  2. windows-msvc-x64
  3. macos-clang-x64

But when I checked in the documentation here it says the following.

screenshot of documentation

Conclusion

I would go with the contextual documentation since official documentation builds can lag behind.


Version Details

  • Version: 1.73.0
  • Electron: 19.0.17
  • Chromium: 102.0.5005.167
  • Node.js: 16.14.2
  • V8: 10.2.154.15-electron.0
  • OS: Linux x64 5.15.0-52-generic snap
  • Sandboxed: No
  • C/C++ Extension: v1.12.4

Upvotes: 0

Manny
Manny

Reputation: 43

I was having the same problem, if you're using Windows

I used "g++.exe" enter image description here

Then I changed the "IntelliSense mode" to "windows-gcc-x64" to get rid of the warning enter image description here

Upvotes: 1

Shivam Goel
Shivam Goel

Reputation: 377

I am getting this warning because of line number 16 enter image description here

Just change "intelliSenseMode": "windows-msvc-x64" to "intelliSenseMode": "windows-gcc-x64"

Upvotes: 2

salbeira
salbeira

Reputation: 2583

Because Artemy Vysotsky did not post his answer as an answer:

The documentation states that "msvc-x64" and "clang-x64" are the only possible values.

Upvotes: 14

Joel Santos Rico
Joel Santos Rico

Reputation: 336

Since v0.25, 32 bit modes are supported. The valid options are msvc-x64, gcc-x64, clang-x64 and their 32 bit counterparts msvc-x86, gcc-x86, clang-x86. There's also the ${default} option that Fábio Lobão mentions.

(Source: https://github.com/microsoft/vscode-cpptools/issues/2312)

Upvotes: 0

Related Questions