I migrated (with substantial help from folks like @MultipleMonomials and @JonnyK ) the “Blinky” example program from MBed Studio to VS Code. I got it to build and run ok, but I noticed a problem with the intellisense feature of the VS Code IDE.
Basically, intellisense does not appear to work… for instance, here is a screenshot of a snippet of a cpp file:
Notice the squigglies… If I hover over one of those (e.g. LED_RED), it produces a pop-up with the message: identifier “LED_RED” is undefined. However, the project builds just fine.
I dug a bit into this, and from what I understand, there was an implication that the intellisense feature is built on Make. Back when I last used VS Code (another job), the CMake built Makefiles, which could be used by intellisense to parse the code and allow you to easily navigate around.
Apparently, things have changed, and now CMake invokes a build system called Ninja, which bypasses the need for Make – so intellisense doesn’t have the makefiles for navigation.
Or maybe I’m completely not understanding how intellisense works, and I’ve just missed a setting somewhere.
Can somebody point me in the right direction to get past this?
I’m running on a MacBook with
macOS Monterey 12.6
build variant Debug MAX32620FTHR
GCC 10.3.1 arm-none-eabi-gcc
IntelliSense mode: $(default)
Include path setting:
${workspaceFolder}
${workspaceFolder}/mbed-os/**
Here is my c_cpp_properties.json file:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}",
"${workspaceFolder}/mbed-os/**"
],
"defines": [],
"macFrameworkPath": [],
"compilerPath": "/opt/homebrew/bin/arm-none-eabi-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "${default}",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
The line: “configurationProvider”: “ms-vscode.makefile-tools” looks suspicious, but I’m having some difficulty figuring out where it comes from or how to change it.