forked from platformio/platformio-core
Keep custom "unwantedRecommendations" when generating projects for VSCode // Resolve #4383
This commit is contained in:
1 parent
e2f0d96f09
commit
bc9d9ac2db
2 files changed
+13
-3
No files matched your search
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user