@@ -8,6 +8,8 @@ One side effect of this change is that snippets created in the previous version
8
8
this extension will not be supported. The /snippets folder will continue to be available
9
9
if previously created in a project folder.
10
10
11
+ In addition, the searching/tag feature has been expanded as well.
12
+
11
13
12
14
Transferring Single Snippets
13
15
----------------------------
@@ -78,15 +80,42 @@ script to help with the transition:
78
80
counter+=1
79
81
80
82
snippets.sort(key=extract_id)
83
+ print('{"snippets": [\n')
81
84
for snip in snippets:
82
85
if not('tags' in snip):
83
86
snip["tags"] = []
84
87
if snippets.index(snip) == len(snippets)-1:
85
- print(snip)
88
+ print(json.dumps( snip, indent=4, sort_keys=True) )
86
89
else:
87
- print(snip, end=",\n")
90
+ print(json.dumps(snip, indent=4, sort_keys=True), end=",\n")
91
+ print("]\n}\n")
88
92
89
93
90
94
This script will concatenate and print out all of the json objects in a /snippets folder
91
95
in a project. After running the script, copy the output and paste into the User Preferences
92
96
panel in settings, similar to the single snippet upload.
97
+
98
+
99
+ Search and Tag Update
100
+ ---------------------
101
+ .. image :: ../Design/unselectedTags.png
102
+ :align: center
103
+
104
+ NOTE: Snippet tags function on an OR basis, as in when the "data analytics" tag and the "import statements" tag are selected together,
105
+ the panel displays any tags that are tagged as import statements OR tagged as "data analytics."
106
+ ex) Snippet tags selected together:
107
+ .. image :: ../Design/snippetTagsSelected.png
108
+ :align: center
109
+
110
+ ex) Language tags selected together:
111
+ .. image :: ../Design/languageTagsSelected.png
112
+ :align: center
113
+
114
+ NOTE 2: Language tags and snippets tags have an AND relationship. As in when the "Python" tag and the "data analytics" tags are selected together,
115
+ only snippets that are both in the language Python AND tagged as data analytics will appear.
116
+ .. image :: ../Design/langAndSnippetTag.png
117
+ :align: center
118
+
119
+ NOTE 3: When language tags are selected, only snippet tags in that language will appear for ease of selection.
120
+ .. image :: ../Design/pythonTagOnly.png
121
+ :align: center
0 commit comments