Skip to content

Commit

Permalink
Allow in-progress language standards in IDE templates // Resolve #3653
Browse files Browse the repository at this point in the history
Note: VS Code only supports finalized names
  • Loading branch information
valeros committed Sep 9, 2020
1 parent 429f416 commit 2a30ad0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PlatformIO Core 5

- Fixed an issue when using a custom git/ssh package with `platform_packages <https://docs.platformio.org/page/projectconf/section_env_platform.html#platform-packages>`__ option (`issue #3624 <https://github.com/platformio/platformio-core/issues/3624>`_)
- Fixed an issue with "ImportError: cannot import name '_get_backend' from 'cryptography.hazmat.backends'" when using `Remote Development <https://docs.platformio.org/page/plus/pio-remote.html>`__ on RaspberryPi device (`issue #3652 <https://github.com/platformio/platformio-core/issues/3652>`_)
- Fixed an issue with incorrect value for C++ language standard in IDE projects when an in-progress language standard is used (`issue #3653 <https://github.com/platformio/platformio-core/issues/3653>`_)

5.0.0 (2020-09-03)
~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ SET(CMAKE_CXX_COMPILER "{{ _normalize_path(cxx_path) }}")
SET(CMAKE_CXX_FLAGS "{{ _normalize_path(to_unix_path(cxx_flags)) }}")
SET(CMAKE_C_FLAGS "{{ _normalize_path(to_unix_path(cc_flags)) }}")

% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
% cc_stds = STD_RE.findall(cc_flags)
% cxx_stds = STD_RE.findall(cxx_flags)
% if cc_stds:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% import re
% STD_RE = re.compile(r"(\-std=[a-z\+]+\d+)")
% STD_RE = re.compile(r"(\-std=[a-z\+]+\w+)")
% cxx_stds = STD_RE.findall(cxx_flags)
% cxx_std = cxx_stds[-1] if cxx_stds else ""
%
Expand Down
2 changes: 1 addition & 1 deletion platformio/ide/tpls/emacs/.ccls.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% import re
% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
% cc_stds = STD_RE.findall(cc_flags)
% cxx_stds = STD_RE.findall(cxx_flags)
%
Expand Down
2 changes: 1 addition & 1 deletion platformio/ide/tpls/vim/.ccls.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% import re
% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
% cc_stds = STD_RE.findall(cc_flags)
% cxx_stds = STD_RE.findall(cxx_flags)
%
Expand Down
12 changes: 10 additions & 2 deletions platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
%
% systype = platform.system().lower()
%
% cpp_standards_remap = {
% "0x": "11",
% "1y": "14",
% "1z": "17",
% "2a": "20",
% "2b": "23"
% }
%
% def _escape(text):
% return to_unix_path(text).replace('"', '\\"')
% end
Expand Down Expand Up @@ -68,7 +76,7 @@
%
% cleaned_includes = filter_includes(includes, ["toolchain"])
%
% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
% STD_RE = re.compile(r"\-std=[a-z\+]+(\w+)")
% cc_stds = STD_RE.findall(cc_flags)
% cxx_stds = STD_RE.findall(cxx_flags)
% cc_m_flags = split_args(cc_flags)
Expand Down Expand Up @@ -115,7 +123,7 @@
"cStandard": "c{{ cc_stds[-1] }}",
% end
% if cxx_stds:
"cppStandard": "c++{{ cxx_stds[-1] }}",
"cppStandard": "c++{{ cpp_standards_remap.get(cxx_stds[-1], cxx_stds[-1]) }}",
% end
% if forced_includes:
"forcedInclude": [
Expand Down

0 comments on commit 2a30ad0

Please sign in to comment.