Skip to content

VSCode IntelliSense forcedInclude doesn't work #5449

Closed

Description

@programminghoch10

Hi,
I have this in my platformio.ini:

build_flags =
  -include "include/forcedInclude.hpp"

IntelliSense complains that defines from within this file don't exist,
but a compile succeeds as expected.
Looking at the generated c_cpp_properties.json:

      "forcedInclude": [
        "include/forcedInclude.hpp",
        ""
      ],

I have found this bug,
which made me think the issue is that the cpptools extension isn't able to parse the relative include,
but downgrading that one to before the regression did not resolve the issue.
This however lead me to try an absolute path in c_cpp_properties.json:

      "forcedInclude": [
        "${workspaceFolder}/include/forcedInclude.hpp",
        ""
      ],

which made IntelliSense detect the defines correctly.
During PlatformIO's building IntelliSense index
all other include paths are generated with an absolute path.
Would it be possible to also apply this absolute path to forcedInclude?
This would fix this issue and will make IntelliSense behave correctly & the same as the compiler does.

Activity

  1. added this to the 6.2.0 milestone on Sep 5, 2026
  2. ivankravets commented on Sep 5, 2026

    @ivankravets
    Member

    Thanks for the report! Please re-test with pio upgrade --dev.

  3. added a commit that references this issue on Sep 5, 2026
    9bd69fa
  4. added a commit that references this issue on Sep 15, 2026
    c80dad5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions