Intellisense include errors when Particle Workbench extension is enabled

See screenshots below.

With Particle workbench core v 1.16.34 enabled:

With Particle workbench core disabled:

I tried installing previous versions of workbench core and it appears that the problem is still there in 1.16.33 and 1.16.32 as well, so this is not a new problem.

Note that the project still compiles properly (intellisense error only).

How can I fix these intellisense errors? Do I need to change all my include paths to be relative? That seems like a bad solution given that the compilation process works fine...

Here is my c++ configuration JSON file:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/src/**",
                "C:\\PARTICLE_LOCAL\\jaza_embedded\\pTest\\src\\**",
                "C:/PARTICLE_LOCAL/jaza_embedded/pTest/src/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "windows-clang-x64",
            "configurationProvider": "particle.particle-vscode-core"
        }
    ],
    "version": 4
}

I'm not sure why it's not working for you, but with the default configuration on the Mac, I don't get an Intellisense warning in the subfolder .c or .cpp files.

If I include a non-existent file like app_main2.h I get the red squiggle warning, so Intellisense is working.

I created a new project using Create New Project and I had the default .vscode/settings.json file:

{
    "extensions.ignoreRecommendations": true,
    "C_Cpp.default.configurationProvider": "particle.particle-vscode-core",
    "files.associations": {
        "*.ino": "cpp"
    }
}

I also tested with Windows 11 and it worked properly. I'd guess it might have something to do with your custom path configuration, but I'm not really sure specifically what is wrong with it.

1 Like

What do you mean by that? Are you referring to the custom includePath entries in the c_cpp_properties.json file? Or are you talking about my user environment variables?

If so, I deleted the custom ones that I had added to try and get the intellisense to work. I am now using the default configuration, i.e.:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "windows-clang-x64",
            "configurationProvider": "particle.particle-vscode-core"
        }
    ],
    "version": 4
}

I still have the intellisense errors:

I ran Particle: Audit environment command and here is what I got:

{
    "username": null,
    "workspace": {
        "name": "Untitled (Workspace)",
        "isWorkspace": true,
        "folders": [
            {
                "location": "c:\\PARTICLE_LOCAL\\jaza_embedded\\pTest",
                "hasValidPath": true,
                "settings": {
                    "firmwareName": "deviceOS",
                    "firmwareVersion": "3.1.0",
                    "targetDevice": "",
                    "targetPlatform": "boron",
                    "debugWarningShown": false,
                    "compileButtonAction": "localAppDeviceOS",
                    "flashButtonAction": "localAppDeviceOS",
                    "disableWelcomeScreen": true,
                    "disableDeviceOSOutdatedCheck": true,
                    "disableLocalCompilerDirtyCheck": true,
                    "enableVerboseLocalCompilerLogging": true,
                    "compileDefines": [],
                    "customDeviceOSLocation": "",
                    "maxAllowedToolchains": 4,
                    "enablePre-releaseDeviceOSBuilds": true
                },
                "files": [
                    ".github",
                    ".github\\workflows",
                    ".gitignore",
                    ".vscode",
                    ".vscode\\c_cpp_properties.json",
                    ".vscode\\launch.json",
                    ".vscode\\settings.json",
                    "project.properties",
                    "README.md",
                    "src",
                    "src\\app_main.h",
                    "src\\pTest.cpp",
                    "src\\subfolder"
                ]
            }
        ]
    },
    "cli": {
        "binpath": "C:\\Users\\Boompy\\AppData\\Local\\particle\\bin\\particle.exe",
        "ok": true,
        "version": "3.33.5",
        "installed": 1742307177247
    },
    "localCompiler": {
        "ok": true,
        "dependencies": [
            {
                "id": "deviceOS@6.3.0",
                "ok": true
            },
            {
                "id": "gcc-arm@10.2.1",
                "ok": true
            },
            {
                "id": "buildtools@1.1.1",
                "ok": true
            },
            {
                "id": "buildscripts@1.16.0",
                "ok": true
            },
            {
                "id": "openocd@0.12.0-particle.2",
                "ok": true
            },
            {
                "id": "deviceOS@6.1.1",
                "ok": true
            },
            {
                "id": "deviceOS@5.9.0",
                "ok": true
            },
            {
                "id": "deviceOS@3.1.0",
                "ok": true
            },
            {
                "id": "buildscripts@1.10.1",
                "ok": true
            },
            {
                "id": "deviceOS@2.3.1",
                "ok": true
            },
            {
                "id": "gcc-arm@9.2.1",
                "ok": true
            },
            {
                "id": "deviceOS@2.3.0",
                "ok": true
            }
        ]
    },
    "platform": {
        "os": "windows",
        "type": "Windows_NT",
        "release": "10.0.19045",
        "arch": "x64",
        "path": {
            "key": "Path",
            "value": "C:\\Program Files\\Python313\\Scripts\\;C:\\Program Files\\Python313\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\LLVM\\bin;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\;C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;C:\\Program Files\\nodejs\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Git\\cmd;;C:\\Program Files\\NVIDIA Corporation\\NVIDIA app\\NvDLISR;C:\\Ruby33-x64\\bin;C:\\Users\\Boompy\\AppData\\Local\\Microsoft\\WindowsApps;C:\\OpenSSL-Win32\\bin;C:\\Users\\Boompy\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files\\srecord\\bin;C:\\Program Files (x86)\\teraterm;C:\\Users\\Boompy\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\bin;C:\\Program Files\\nodejs;C:\\Users\\Boompy\\AppData\\Roaming\\npm;C:\\Users\\Boompy\\AppData\\Local\\particle\\bin;C:\\Program Files\\Python313;C:\\Program Files\\Python313\\Scripts;",
            "entries": [
                "C:\\Program Files\\Python313\\Scripts\\",
                "C:\\Program Files\\Python313\\",
                "C:\\WINDOWS\\system32",
                "C:\\WINDOWS",
                "C:\\WINDOWS\\System32\\Wbem",
                "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\",
                "C:\\WINDOWS\\System32\\OpenSSH\\",
                "C:\\Program Files\\PuTTY\\",
                "C:\\Program Files\\dotnet\\",
                "C:\\Program Files\\LLVM\\bin",
                "C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\",
                "C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\",
                "C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin",
                "C:\\Program Files\\nodejs\\",
                "C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common",
                "C:\\Program Files\\Git\\cmd",
                "",
                "C:\\Program Files\\NVIDIA Corporation\\NVIDIA app\\NvDLISR",
                "C:\\Ruby33-x64\\bin",
                "C:\\Users\\Boompy\\AppData\\Local\\Microsoft\\WindowsApps",
                "C:\\OpenSSL-Win32\\bin",
                "C:\\Users\\Boompy\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
                "C:\\Program Files\\srecord\\bin",
                "C:\\Program Files (x86)\\teraterm",
                "C:\\Users\\Boompy\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\bin",
                "C:\\Program Files\\nodejs",
                "C:\\Users\\Boompy\\AppData\\Roaming\\npm",
                "C:\\Users\\Boompy\\AppData\\Local\\particle\\bin",
                "C:\\Program Files\\Python313",
                "C:\\Program Files\\Python313\\Scripts",
                ""
            ]
        },
        "homeDir": "C:\\Users\\Boompy",
        "particleDir": "C:\\Users\\Boompy\\.particle",
        "particleToolchainDir": "C:\\Users\\Boompy\\.particle\\toolchains"
    },
    "env": {
        "ALLUSERSPROFILE": "C:\\ProgramData",
        "APPDATA": "C:\\Users\\Boompy\\AppData\\Roaming",
        "BossRepoPath": "C:\\PARTICLE_LOCAL\\BossApp",
        "CARBON_MEM_DISABLE": "1",
        "CHROME_CRASHPAD_PIPE_NAME": "\\\\.\\pipe\\crashpad_9056_LQLWRHOYRKKWTZTW",
        "COMPUTERNAME": "TOMS_TOWER",
        "ComSpec": "C:\\WINDOWS\\system32\\cmd.exe",
        "CommonProgramFiles": "C:\\Program Files\\Common Files",
        "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files",
        "CommonProgramW6432": "C:\\Program Files\\Common Files",
        "DOWNLOADSPATH": "E:\\Downloads",
        "DriverData": "C:\\Windows\\System32\\Drivers\\DriverData",
        "ELECTRON_RUN_AS_NODE": "1",
        "HOMEDRIVE": "C:",
        "HOMEPATH": "\\Users\\Boompy",
        "JP3RepoPath": "C:\\PARTICLE_LOCAL\\JP3",
        "JazaEmbeddedRepoPath": "C:\\PARTICLE_LOCAL\\jaza_embedded",
        "LOCALAPPDATA": "C:\\Users\\Boompy\\AppData\\Local",
        "LOGONSERVER": "\\\\TOMS_TOWER",
        "LinkRepoPath": "C:\\PARTICLE_LOCAL\\LinkApp",
        "NIEXTCCOMPILERSUPP": "C:\\Program Files (x86)\\National Instruments\\Shared\\ExternalCompilerSupport\\C\\",
        "NUMBER_OF_PROCESSORS": "8",
        "OPENSSL_CONF": "C:\\OpenSSL-Win32\\bin\\openssl.cfg",
        "ORIGINAL_XDG_CURRENT_DESKTOP": "undefined",
        "OS": "Windows_NT",
        "OneDrive": "C:\\Users\\Boompy\\OneDrive",
        "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.RB;.RBW",
        "PROCESSOR_ARCHITECTURE": "AMD64",
        "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 60 Stepping 3, GenuineIntel",
        "PROCESSOR_LEVEL": "6",
        "PROCESSOR_REVISION": "3c03",
        "PSModulePath": "C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules",
        "PUBLIC": "C:\\Users\\Public",
        "Path": "C:\\Program Files\\Python313\\Scripts\\;C:\\Program Files\\Python313\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\LLVM\\bin;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\;C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;C:\\Program Files\\nodejs\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Git\\cmd;;C:\\Program Files\\NVIDIA Corporation\\NVIDIA app\\NvDLISR;C:\\Ruby33-x64\\bin;C:\\Users\\Boompy\\AppData\\Local\\Microsoft\\WindowsApps;C:\\OpenSSL-Win32\\bin;C:\\Users\\Boompy\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files\\srecord\\bin;C:\\Program Files (x86)\\teraterm;C:\\Users\\Boompy\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\bin;C:\\Program Files\\nodejs;C:\\Users\\Boompy\\AppData\\Roaming\\npm;C:\\Users\\Boompy\\AppData\\Local\\particle\\bin;C:\\Program Files\\Python313;C:\\Program Files\\Python313\\Scripts;",
        "ProgramData": "C:\\ProgramData",
        "ProgramFiles": "C:\\Program Files",
        "ProgramFiles(x86)": "C:\\Program Files (x86)",
        "ProgramW6432": "C:\\Program Files",
        "SESSIONNAME": "Console",
        "STM32CUBEIDEPATH": "C:\\ST\\STM32CubeIDE_1.17.0\\STM32CubeIDE",
        "SystemDrive": "C:",
        "SystemRoot": "C:\\WINDOWS",
        "TEMP": "C:\\Users\\Boompy\\AppData\\Local\\Temp",
        "TMP": "C:\\Users\\Boompy\\AppData\\Local\\Temp",
        "USERDOMAIN": "TOMS_TOWER",
        "USERDOMAIN_ROAMINGPROFILE": "TOMS_TOWER",
        "USERNAME": "Boompy",
        "USERPROFILE": "C:\\Users\\Boompy",
        "VSCODE_CODE_CACHE_PATH": "C:\\Users\\Boompy\\AppData\\Roaming\\Code\\CachedData\\ddc367ed5c8936efe395cffeec279b04ffd7db78",
        "VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost",
        "VSCODE_CWD": "C:\\WINDOWS\\system32",
        "VSCODE_ESM_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
        "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
        "VSCODE_IPC_HOOK": "\\\\.\\pipe\\55d4a822-1.98.2-main-sock",
        "VSCODE_L10N_BUNDLE_LOCATION": "",
        "VSCODE_NLS_CONFIG": "{\"userLocale\":\"en-us\",\"osLocale\":\"en-us\",\"resolvedLanguage\":\"en\",\"defaultMessagesFile\":\"C:\\\\Users\\\\Boompy\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\resources\\\\app\\\\out\\\\nls.messages.json\",\"locale\":\"en-us\",\"availableLanguages\":{}}",
        "VSCODE_PID": "9056",
        "VXIPNPPATH": "C:\\Program Files (x86)\\IVI Foundation\\VISA\\",
        "VXIPNPPATH64": "C:\\Program Files\\IVI Foundation\\VISA\\",
        "__PSLockDownPolicy": "0",
        "windir": "C:\\WINDOWS"
    },
    "versions": {
        "node": "20.18.2",
        "acorn": "8.12.1",
        "ada": "2.9.0",
        "ares": "1.33.1",
        "base64": "0.5.2",
        "brotli": "1.0.9",
        "cjs_module_lexer": "1.4.1",
        "cldr": "44.1",
        "icu": "74.2",
        "llhttp": "8.1.2",
        "modules": "132",
        "napi": "9",
        "nghttp2": "1.61.0",
        "openssl": "0.0.0",
        "simdutf": "5.5.0",
        "tz": "2024b",
        "undici": "6.21.1",
        "unicode": "15.1",
        "uv": "1.46.0",
        "uvwasi": "0.0.21",
        "v8": "13.2.152.36-electron.0",
        "zlib": "1.3.0.1-motley",
        "electron": "34.2.0",
        "chrome": "132.0.6834.196",
        "microsoft-build": "11161602"
    },
    "vscode": {
        "appName": "Visual Studio Code",
        "appRoot": "c:\\Users\\Boompy\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "machineId": "4a89d491b321dd4d3234f706c8366d7dc6082e1467420845d6c2765b2cd50f61",
        "sessionId": "c89fa0d4-daa1-4eec-91c5-20fb1133780b1742393843688",
        "version": "1.98.2"
    },
    "extensions": [
        {
            "id": "ms-vscode.js-debug",
            "version": "1.97.1"
        },
        {
            "id": "ms-vscode.js-debug-companion",
            "version": "1.1.3"
        },
        {
            "id": "ms-vscode.vscode-js-profile-table",
            "version": "1.0.10"
        },
        {
            "id": "marus25.cortex-debug",
            "version": "1.12.1"
        },
        {
            "id": "mcu-debug.debug-tracker-vscode",
            "version": "0.0.15"
        },
        {
            "id": "mcu-debug.memory-view",
            "version": "0.0.25"
        },
        {
            "id": "mcu-debug.peripheral-viewer",
            "version": "1.4.6"
        },
        {
            "id": "mcu-debug.rtos-views",
            "version": "0.0.7"
        },
        {
            "id": "ms-vscode.cpptools",
            "version": "1.24.3"
        },
        {
            "id": "ms-vscode.cpptools-extension-pack",
            "version": "1.3.1"
        },
        {
            "id": "mtxr.sqltools",
            "version": "0.28.4"
        },
        {
            "id": "particle.particle-vscode-core",
            "version": "1.16.34"
        },
        {
            "id": "particle.particle-vscode-pack",
            "version": "1.16.34"
        },
        {
            "id": "particle.particle-vscode-snippets",
            "version": "1.16.34"
        },
        {
            "id": "particle.particle-vscode-theme",
            "version": "1.16.34"
        }
    ]
}
1 Like

did you ever get this fixed? I'm having the same problem here and I can't get the errors to go away. Project will Compile and upload to device just fine, but my OCD just can't take the red squiggly lines.

A few common issues that will affect Intellisense:

  • Use a single root project. In other words, open the directory that contains the top level of one project (where the project.properties file is), not a higher level.
  • Make sure you have a fully configured Particle project, containing the project.properties file and the .vscode directory with settings. The easiest way is to use Particle: Create New Project.
  • There are a couple more tips in this post that may or may not help.

No, never got it fixed.

Whenever my OCD kicks in while looking at a file, I just edit the include path to be relative to make the squiggles go away

:person_shrugging:

There is a new release of Particle Workbench Core (1.16.37) available that should fix this issue.

2 Likes

Hi @rickkas7 , it so happened that I am now facing this same issue immediately after my workbench updated to this new release (1.16.37).
It's it has been frustrating, especially since I am working on a new firmware update for my client that needs to be urgently deployed to devices that have already been deployed to end users.
It's drastically slowing down my work as it's quite challenging to work at a good pace without those intellisenses on.

You should change your include paths to be relative if you can stomache it...

Hi @jaza_tom, thanks for this tip. I have already tried adding the directories to my include path and the compiler path as well. It worked for only my custom header files, and a large chunk of the #include errors have disappeared.
However, there's still one left with the "Particle.h" header. The intellisense is not able to find most of the headers either. I had to check the main installation folder of the Particle Workbench to search for their actual directories to add to the include path as well.
Now, one of the internal headers, known as " bits\ghtr.h", is still being reported as inaccessible. Although I have added its file path to the settings.json file.
Here's the error that I am currently facing with the edits I made to my settings.json file.

[{
"message": "#include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit (C:\\shyft_particle\\gx-firmware\\src\\main.cpp).",
	"source": "C/C++",
	"startLineNumber": 2,
	"startColumn": 1,
	"endLineNumber": 2,
	"endColumn": 17
}]

[{
	"message": "cannot open source file \"bits/gthr.h\" (dependency of \"C:\\Users\\HP\\.particle\\toolchains\\deviceOS\\2.3.0\\user\\inc\\Particle.h\")",
	"source": "C/C++",
	"startLineNumber": 2,
	"startColumn": 1,
	"endLineNumber": 2,
	"endColumn": 17
}]

Here is the settings.json file with the modified paths:

{
    "C_Cpp.default.configurationProvider": "particle.particle-vscode-core",
    "C_Cpp.autoAddFileAssociations": true,
    "C_Cpp.configurationWarnings": "enabled",
    "C_Cpp.default.cppStandard": "c++14",
    "C_Cpp.default.cStandard": "c11",
    "C_Cpp.default.intelliSenseMode": "gcc-arm64",
    "C_Cpp.default.recursiveIncludes.order": "depthFirst",
    "C_Cpp.default.systemIncludePath": [
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\arm-none-eabi\\include",
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\arm-none-eabi\\include\\c++\\10.2.1",
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\arm-none-eabi\\include\\c++\\10.2.1\\bits",
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\arm-none-eabi\\include\\c++\\10.2.1\\arm-none-eabi\\thumb\\v8.1-m.main+mve\\hard\\bits",
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\arm-none-eabi\\include\\machine",
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\arm-none-eabi\\include\\newlib-nano",
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\arm-none-eabi\\include\\ssp",
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\arm-none-eabi\\include\\sys",
        "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\lib\\gcc\\arm-none-eabi\\10.2.1\\include",
        "C:\\shyft_particle\\gx-firmware\\lib\\CellularHelpers\\src",
        "C:\\shyft_particle\\gx-firmware\\lib\\Modbus_RS485_library\\src",
        "C:\\shyft_particle\\gx-firmware\\lib\\SHYFTDefines\\src",
        "C:\\shyft_particle\\gx-firmware\\lib\\SpiffsParticleRK\\src",
        "C:\\shyft_particle\\gx-firmware\\lib\\SpiFlashRK\\src",
        "C:\\shyft_particle\\gx-firmware\\lib\\TCA9535_Port_Expander\\src"
    ],
    "C_Cpp.default.compilerPath": "C:\\Users\\HP\\.particle\\toolchains\\gcc-arm\\10.2.1\\bin\\arm-none-eabi-g++.exe",
    "particle.firmwareVersion": "2.3.0",
    "particle.targetPlatform": "electron",
    "files.associations": {
        "functional": "cpp",
        "memory": "cpp",
        "optional": "cpp",
        "sstream": "cpp",
        "new": "cpp",
        "unordered_map": "cpp",
        "initializer_list": "cpp",
        "typeinfo": "cpp"
    },
    "particle.targetDevice": ""
}

Please, someone should help with resolving this.
Could there be something I am not doing right?