Skip to content

Commit

Permalink
Do not overwrite a custom items in VSCode's "extensions.json" // Resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Feb 8, 2020
1 parent 96f60aa commit 86f2dde
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Expand Up @@ -34,6 +34,7 @@ PlatformIO Core 4.0
* Updated Unity tool to 2.5.0
* Made package ManifestSchema compatible with marshmallow >= 3 (`issue #3296 <https://github.com/platformio/platformio-core/issues/3296>`_)
* Warn about broken library manifest when scanning dependencies (`issue #3268 <https://github.com/platformio/platformio-core/issues/3268>`_)
* Do not overwrite a custom items in VSCode's "extensions.json" (`issue #3374 <https://github.com/platformio/platformio-core/issues/3374>`_)
* Fixed an issue when ``env.BoardConfig()`` does not work for custom boards in extra scripts of libraries (`issue #3264 <https://github.com/platformio/platformio-core/issues/3264>`_)
* Fixed an issue with "start-group/end-group" linker flags on Native development platform (`issue #3282 <https://github.com/platformio/platformio-core/issues/3282>`_)
* Fixed default PIO Unified Debugger configuration for `J-Link probe <http://docs.platformio.org/page/plus/debug-tools/jlink.html>`__
Expand All @@ -45,6 +46,7 @@ PlatformIO Core 4.0
* Fixed an issue with improperly handled compiler flags with space symbols in VSCode template (`issue #3364 <https://github.com/platformio/platformio-core/issues/3364>`_)
* Fixed an issue when no error is raised if referred parameter (interpolation) is missing in a project configuration file (`issue #3279 <https://github.com/platformio/platformio-core/issues/3279>`_)


4.1.0 (2019-11-07)
~~~~~~~~~~~~~~~~~~

Expand Down
27 changes: 21 additions & 6 deletions platformio/ide/tpls/vscode/.vscode/extensions.json.tpl
@@ -1,7 +1,22 @@
% import json
% import os
% import re
%
% recommendations = set(["platformio.platformio-ide"])
% previous_json = os.path.join(project_dir, ".vscode", "extensions.json")
% if os.path.isfile(previous_json):
% with open(previous_json) as fp:
% contents = re.sub(r"^\s*//.*$", "", fp.read(), flags=re.M).strip()
% if contents:
% recommendations |= set(json.loads(contents).get("recommendations", []))
% end
% end
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
% for i, item in enumerate(sorted(recommendations)):
"{{ item }}"{{ ("," if (i + 1) < len(recommendations) else "") }}
% end
]
}

0 comments on commit 86f2dde

Please sign in to comment.