From a092f87c5070e78dc9e7319c3e6c32c8e2dc3bfc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 21:57:39 +0200 Subject: [PATCH] Eclipse: Provide language standard to a project C/C++ indexer // Resolve #1010 --- HISTORY.rst | 2 ++ .../eclipse/.settings/language.settings.xml.tpl | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 9ba9e6f6..d42f4c92 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -21,6 +21,8 @@ PlatformIO 3.0 - Use full path to PlatformIO CLI when generating a project (`issue #1674 `_) - CLion: Improved project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of full path + - Eclipse: Provide language standard to a project C/C++ indexer + (`issue #1010 `_) * Fixed an issue with incorrect detecting of compatibility (LDF) between generic library and Arduino or ARM mbed frameworks * Fixed "Runtime Error: Dictionary size changed during iteration" diff --git a/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl b/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl index 19740737..72895fb2 100644 --- a/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl +++ b/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl @@ -1,3 +1,8 @@ +% import re +% STD_RE = re.compile(r"(\-std=[a-z\+]+\d+)") +% cxx_stds = STD_RE.findall(cxx_flags) +% cxx_std = cxx_stds[-1] if cxx_stds else "" +% @@ -6,9 +11,9 @@ % if "windows" in systype: - + % else: - + % end @@ -21,9 +26,9 @@ % if "windows" in systype: - + % else: - + % end