Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

forcedInclude should not apply to .cpp files (can I disable it entirely?) #1506

Open
@tlokovic

Description

@tlokovic

The Arduino build environment auto-includes Arduino.h from .ino files, but it does not do this for .h and .cpp files.

The VSCode Arduino extension tries to mimic this by adding a "forcedInclude" to the auto-generated c_cpp_properties.json, with a path to Arduino.h. This forcedInclude applies to both .ino files and .cpp files, but it should only apply to .ino files.

The result is that Intellisense gets different compilation results on .cpp files than what you see when you run Verify. In my case Intellisense is giving name collisions in .cpp files because it's auto-including Arduino.h when it shouldn't.

I'd be thrilled if I could just disable the forcedInclude entirely, but if I remove it from the workspace's c_cpp_properties.json, it just reappears moments later. (I assume it's the Arduino extension that is doing that, but I'm unclear.)

Is there a way I can prevent this forcedInclude from constantly reappearing in c_cpp_properties.json? (An even better fix would be for it to apply only to .ino files, but that sounds even harder.)

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions