thelsing / knx

knx stack (TP, IP and RF) for arduino and linux, Can be configured with ETS
GNU General Public License v3.0
276 stars 95 forks source link

Fix IntelliSense w/ PlatformIO IDE on Linux #240

Closed ginkel closed 1 year ago

ginkel commented 1 year ago

IntelliSense was broken in downstream projects in VS Code w/ the PlatformIO IDE plugin on Linux (as inet.h does not end up on VS Code's include path).

This PR fixes this by removing the include from knx/bits.h as it is also included directly by linux_platform.cpp and removing the include solves the IntelliSense issues.

thelsing commented 1 year ago

You broke the native build. Please fix that.

ginkel commented 1 year ago

I'm sorry, I wasn't aware that building a downstream project is not sufficient to ensure that knx builds correctly.

Which fix would you prefer? Include inet.h directly everywhere it's needed or use the macro definitions from bits.h on all platforms? A third option I missed?

thelsing commented 1 year ago

Having thought about it a bit I think it's strange that you want to remove the include. PlatformIO intellisense shouldn't define linux if you are on an embedded platform. It's probably easier to fix it vscode than changing the code.

Regarding to where to change: less changes are mostly better ;)

ginkel commented 1 year ago

I figured out a workaround that does not require any code changes in knx, so I am closing this PR for now.