Visual Studio Code Intellisense Mode
Asked Answered
S

6

14

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.

Sal answered 15/9, 2017 at 14:49 Comment(2)
github.com/Microsoft/vscode-cpptools/blob/master/Documentation/… - specifies 2 possibilities "msvc-x64" / "clang-x64". Second is default for Linux envLesialesion
Huh I don't know what I googled wrong but that page did not appear in my first 10 results.Sal
S
14

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.

Sal answered 27/9, 2017 at 19:48 Comment(2)
As of now it is also possible to choose gcc-x64. (supposedly the default value on Linux but my Linux vscode installation defaults to clang-x64)Heraclid
This answer is out of date, many values are actually possible. See code.visualstudio.com/docs/cpp/…Storage
L
8

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.

Linalool answered 9/5, 2019 at 9:3 Comment(0)
J
2

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"

Janinajanine answered 6/7, 2021 at 12:19 Comment(0)
S
1

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

Subterfuge answered 27/6, 2022 at 2:36 Comment(0)
C
0

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)

Contemplate answered 18/2, 2020 at 15:49 Comment(0)
M
0

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
Mercurial answered 2/11, 2022 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.