forked from platformio/platformio-core
Do not overwrite a custom items in VSCode's "extensions.json" // Resolve #3374
This commit is contained in:
1 parent
96f60aab66
commit
86f2dde6f3
2 files changed
+23
-6
No files matched your search
+21
-6
@@ -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
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user