diff --git a/HISTORY.rst b/HISTORY.rst index 7ce2aec1..2b78b705 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,7 @@ PlatformIO 3.0 3.6.2 (2018-??-??) ~~~~~~~~~~~~~~~~~~ +* Improved IntelliSense for `PlatformIO IDE for VSCode `__ via passing extra compiler information for C/C++ Code Parser (resolves issues with spurious project's "Problems") * Fixed an issue with VSCode IntelliSense warning about the missed headers located in `include `__ folder * Fixed incorrect wording when initializing/updating project * Fixed an issue with incorrect order for library dependencies ``CPPPATH`` diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index 9a35b6e3..0e6bf31a 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -134,8 +134,8 @@ def _get_svd_path(env): def DumpIDEData(env): - LINTCCOM = "$CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS" - LINTCXXCOM = "$CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS" + LINTCCOM = "$CFLAGS $CCFLAGS $CPPFLAGS" + LINTCXXCOM = "$CXXFLAGS $CCFLAGS $CPPFLAGS" data = { "libsource_dirs": diff --git a/platformio/ide/tpls/atom/.gcc-flags.json.tpl b/platformio/ide/tpls/atom/.gcc-flags.json.tpl index 5af2ea3a..20942a7a 100644 --- a/platformio/ide/tpls/atom/.gcc-flags.json.tpl +++ b/platformio/ide/tpls/atom/.gcc-flags.json.tpl @@ -1,7 +1,8 @@ +% _defines = " ".join(["-D%s" % d for d in defines]) { "execPath": "{{ cxx_path.replace("\\", "/") }}", - "gccDefaultCFlags": "-fsyntax-only {{! cc_flags.replace(' -MMD ', ' ').replace('"', '\\"') }}", - "gccDefaultCppFlags": "-fsyntax-only {{! cxx_flags.replace(' -MMD ', ' ').replace('"', '\\"') }}", + "gccDefaultCFlags": "-fsyntax-only {{! cc_flags.replace(' -MMD ', ' ').replace('"', '\\"') }} {{ !_defines.replace('"', '\\"') }}", + "gccDefaultCppFlags": "-fsyntax-only {{! cxx_flags.replace(' -MMD ', ' ').replace('"', '\\"') }} {{ !_defines.replace('"', '\\"') }}", "gccErrorLimit": 15, "gccIncludePaths": "{{ ','.join(includes).replace("\\", "/") }}", "gccSuppressWarnings": false diff --git a/platformio/ide/tpls/vim/.gcc-flags.json.tpl b/platformio/ide/tpls/vim/.gcc-flags.json.tpl index 07acafd0..b904e1a3 100644 --- a/platformio/ide/tpls/vim/.gcc-flags.json.tpl +++ b/platformio/ide/tpls/vim/.gcc-flags.json.tpl @@ -1,7 +1,8 @@ +% _defines = " ".join(["-D%s" % d for d in defines]) { "execPath": "{{ cxx_path.replace("\\", "/") }}", - "gccDefaultCFlags": "-fsyntax-only {{! cc_flags.replace(' -MMD ', ' ').replace('"', '\\"') }}", - "gccDefaultCppFlags": "-fsyntax-only {{! cxx_flags.replace(' -MMD ', ' ').replace('"', '\\"') }}", + "gccDefaultCFlags": "-fsyntax-only {{! cc_flags.replace(' -MMD ', ' ').replace('"', '\\"') }} {{ !_defines.replace('"', '\\"') }}", + "gccDefaultCppFlags": "-fsyntax-only {{! cxx_flags.replace(' -MMD ', ' ').replace('"', '\\"') }} {{ !_defines.replace('"', '\\"') }}", "gccErrorLimit": 15, "gccIncludePaths": "{{! ','.join("'{}'".format(w.replace("\\", '/')) for w in includes)}}", "gccSuppressWarnings": false diff --git a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl index 2497f743..d15fb8bd 100644 --- a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl @@ -56,7 +56,7 @@ % if cxx_stds: "cppStandard": "c++{{ cxx_stds[-1] }}", % end - "compilerPath": "{{ cc_path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"') }}" + "compilerPath": "{{ cc_path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"') }} {{! STD_RE.sub("", cc_flags).replace('"', '\\"') }}" } ] } \ No newline at end of file