OS: MacOS Sierra 10.12.6
VSCode: 1.15.1
CppTools: 0.12.3
When I open my project in vscode the intellisense process starts using all the cpu and never stops. Even if I leave it running for hours.
The little red flame in the bottom right says "Parsing..."
Hovering over a symbol says: "Loading..."
But it never exits this state. If I shutdown vscode the Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin process keeps running and consuming a core until I do a Force quit.
Below is my config and I also attached a sample of the intellisense process.
If you need more info the issue is 100% reproducible, so just let me know.
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceRoot}",
"${workspaceRoot}/modules/upnp/inc",
"${workspaceRoot}/modules/utils/inc",
"${workspaceRoot}/modules/audio/inc",
"${workspaceRoot}/build/local-clang4/include",
"${workspaceRoot}/modules/image/inc",
"/usr/include",
"/usr/local/include",
"/usr/local/include/c++/v1",
"/usr/include/machine"
],
"browse": {
"path": [
"${workspaceRoot}/modules/upnp/inc",
"${workspaceRoot}/modules/utils/inc",
"${workspaceRoot}/modules/audio/inc",
"${workspaceRoot}/build/local-clang4/include",
"${workspaceRoot}/modules/image/inc",
"/usr/include",
"/usr/local/include",
"/usr/local/include/c++/v1"
]
},
"intelliSenseMode": "clang-x64"
}
}
I am suffering the same issue.
Sometimes it takes nearly 400% CPU......See below.

VSCode Version: 1.15.1
OS Version: macOS 10.12.6
Only C/C++ tools and C++ intellisence extension installed.
Are either of you able to share a project or code file that reproduces this error? All I can tell from the sample is that the IntelliSense engine is parsing the file.
Encountered the same problem just now while exploring the flexible array member feature in C struct.
OS: MacOS 10.12.6
VSCode: 1.15.1
C/C++ Plugin: 0.12.3
After tried a while, narrowed down the problem to be occurring with below code:
#include <stdio.h>
typedef struct Pixel {
int r;
int g;
int b;
} px;
typedef struct Matrix {
int width;
int height;
px pixel[][];
} matrix;
int main(int argc, char *argv[])
{
return 0;
}
the line px pixel[][] triggers the issue. (I know it's not legitimate now as the clang will throw error about it.)
Hope this info could do some help with the investigation.
To reproduce it with my project:
git clone --recursive https://github.com/dirkvdb/doozy
cd ./doozy && ./bootstrap.sh native && code .
Then Cmd+p and open upnp.http.functions.cpp
The bootstrap script will take a while as it sets up all the project dependencies (ffmpeg, libpng, libjpeg, boost, ... ) but is necessary as it puts all the third party headers in place.
This does require cmake, autotools, yasm, a working compiler, ... in order for the bootstrap to succeed
In my case, reproduce as follows:
1) git clone https://github.com/virgo-coder/EdgeDrawing
2) Open EdgeDrawing directory in VSCode
3) Add include path "${workspaceRoot}/include", it looks like this
"configurations": [
{
"name": "Mac",
"includePath": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"/usr/include/machine",
"${workspaceRoot}",
"${workspaceRoot}/include"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"/usr/include/machine",
"${workspaceRoot}",
"${workspaceRoot}/include"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
4) open examples/example.cpp, it always says "loading" when I point to any symbol. At the same time, Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin keeps consuming a core.
OS Version: macOS 10.12.6
VSCode Version: 1.15.1
C/C++: 0.12.3
C++ Intellisense: 0.2.2
Thanks everyone! I'll take a look at these samples.
@heraclitusq, the code you posted results in an infinite loop in the front end compiler. I passed your case on to the compiler team.
@dirkvdb and @virgo-coder, I can reproduce your issues as well, but haven't determined the root cause yet.
Thanks @bobbrow .
@dirkvdb and @virgo-coder, your cases are the same bug, but a different infinite loop than @heraclitusq. I am passing your issue over to the compiler team as well.
@bobbrow Thanks :)
馃憤 on this issue. Unfortunately i have to defer to a different IDE :-(
0.13.1 has a patch for the issues reported in this thread until I get a proper fix from the compiler team.
I force IntelliSense to exit parsing when the conditions are detected which means you will get incomplete/incorrect IntelliSense for the affected translation units, but we no longer get stuck in an infinite loop.
Thanks!
Most helpful comment
0.13.1 has a patch for the issues reported in this thread until I get a proper fix from the compiler team.
I force IntelliSense to exit parsing when the conditions are detected which means you will get incomplete/incorrect IntelliSense for the affected translation units, but we no longer get stuck in an infinite loop.