Skip to content

Commit

Permalink
Keep custom "unwantedRecommendations" when generating projects for VS…
Browse files Browse the repository at this point in the history
…Code // Resolve #4383
  • Loading branch information
ivankravets committed Aug 9, 2022
1 parent e2f0d96 commit bc9d9ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ PlatformIO Core 6
* Improved device port finder when using dual channel UART converter (`issue #4367 <https://github.com/platformio/platformio-core/issues/4367>`_)
* Improved project dependency resolving when using the `pio project init --ide <https://docs.platformio.org/en/latest/core/userguide/project/cmd_init.html>`__ command
* Upgraded build engine to the SCons 4.4.0 (`release notes <https://github.com/SCons/scons/releases/tag/4.4.0>`__)
* Do not resolve project dependencies on for the ``cleanall`` target (`issue #4344 <https://github.com/platformio/platformio-core/issues/4344>`_)
* Keep custom "unwantedRecommendations" when generating projects for VSCode (`issue #4383 <https://github.com/platformio/platformio-core/issues/4383>`_)
* Do not resolve project dependencies for the ``cleanall`` target (`issue #4344 <https://github.com/platformio/platformio-core/issues/4344>`_)
* Warn about calling "env.BuildSources" in a POST-type script (`issue #4385 <https://github.com/platformio/platformio-core/issues/4385>`_)
* Fixed an issue when escaping macros/defines for IDE integration (`issue #4360 <https://github.com/platformio/platformio-core/issues/4360>`_)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
% import re
%
% recommendations = set(["platformio.platformio-ide"])
% unwantedRecommendations = set(["ms-vscode.cpptools-extension-pack"])
% previous_json = os.path.join(project_dir, ".vscode", "extensions.json")
% if os.path.isfile(previous_json):
% fp = open(previous_json)
% contents = re.sub(r"^\s*//.*$", "", fp.read(), flags=re.M).strip()
% fp.close()
% if contents:
% recommendations |= set(json.loads(contents).get("recommendations", []))
% try:
% data = json.loads(contents)
% recommendations |= set(data.get("recommendations", []))
% unwantedRecommendations |= set(data.get("unwantedRecommendations", []))
% except ValueError:
% pass
% end
% end
% end
{
Expand All @@ -21,6 +28,8 @@
% end
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
% for i, item in enumerate(sorted(unwantedRecommendations)):
"{{ item }}"{{ ("," if (i + 1) < len(unwantedRecommendations) else "") }}
% end
]
}

0 comments on commit bc9d9ac

Please sign in to comment.