How To – Fix VS Code IntelliSense in Pico Extension

Problem

Within a C++ project created by the Pico extension for VS Code, IntelliSense was not finding uint16_t (and some other types) even though the correct header (either <cstdint> or <stdint.h>) was included, and the compiler actually compiled the code OK.

Cause

It turned out that although all the paths were correct in “.vscode/c_cpp_properties.json”, the “cStandard” (c17) and the “cppStandard” (c++14) didn’t match that in the root CMakeLists.txt file [set(CMAKE_C_STANDARD 11) and set(CMAKE_CXX_STANDARD 17)].

Fix

Very simple: Change “.vscode/c_cpp_properties.json” “cStandard”: “c17” to be “cStandard”: “c11”, and “cppStandard”: “c++14” to be “cppStandard”: “c++17”,

I’d like to say that I solved this myself, but sadly I didn’t. After several days of scratching my, already bald, head and Googling like mad trying every crazy idea that the internet had to offer. I eventually asked GitHub’s Co_Pilot, which solved it in less than five minutes! I have suddenly become an AI Assistants evangelist.