|
1 | 1 | { |
2 | | - // Place your python workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and |
3 | | - // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope |
4 | | - // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is |
5 | | - // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: |
6 | | - // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. |
7 | | - // Placeholders with the same ids are connected. |
8 | | - // Example: |
9 | | - // "Print to console": { |
10 | | - // "scope": "javascript,typescript", |
11 | | - // "prefix": "log", |
12 | | - // "body": [ |
13 | | - // "console.log('$1');", |
14 | | - // "$2" |
15 | | - // ], |
16 | | - // "description": "Log output to console" |
17 | | - // } |
| 2 | + // Place your python workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and |
| 3 | + // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope |
| 4 | + // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is |
| 5 | + // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: |
| 6 | + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. |
| 7 | + // Placeholders with the same ids are connected. |
| 8 | + // Example: |
| 9 | + // "Print to console": { |
| 10 | + // "scope": "javascript,typescript", |
| 11 | + // "prefix": "log", |
| 12 | + // "body": [ |
| 13 | + // "console.log('$1');", |
| 14 | + // "$2" |
| 15 | + // ], |
| 16 | + // "description": "Log output to console" |
| 17 | + // } |
18 | 18 |
|
19 | 19 | "Has relative path": { |
20 | | - "scope": "ql", |
21 | | - "prefix": "has relative path", |
| 20 | + "scope": "ql", |
| 21 | + "prefix": "has relative path", |
22 | 22 | "body": [ |
23 | 23 | "exists($1.getLocation().getFile().getRelativePath())" |
24 | 24 | ], |
25 | 25 | "description": "has relative path", |
26 | 26 | }, |
27 | 27 |
|
28 | 28 | "Exists": { |
29 | | - "scope": "ql", |
30 | | - "prefix": "exists", |
| 29 | + "scope": "ql", |
| 30 | + "prefix": "exists", |
31 | 31 | "body": [ |
32 | 32 | "exists(${1:DataFlow::Node node} |", |
33 | 33 | " $2", |
|
37 | 37 | }, |
38 | 38 |
|
39 | 39 | "Predicate": { |
40 | | - "scope": "ql", |
41 | | - "prefix": "predicate", |
| 40 | + "scope": "ql", |
| 41 | + "prefix": "predicate", |
42 | 42 | "body": [ |
43 | 43 | "predicate ${1:isFoo}(${2:DataFlow::Node node}) {", |
44 | 44 | " ${3:any()}", |
|
48 | 48 | }, |
49 | 49 |
|
50 | 50 | "Class": { |
51 | | - "scope": "ql", |
52 | | - "prefix": "class", |
| 51 | + "scope": "ql", |
| 52 | + "prefix": "class", |
53 | 53 | "body": [ |
54 | 54 | "class ${1:MyClass} extends ${2:DataFlow::MethodCallNode} {", |
55 | 55 | " $1() { ${3:getMethodName() = \"foo\"} }", |
|
61 | 61 | }, |
62 | 62 |
|
63 | 63 | "Abstract class": { |
64 | | - "scope": "ql", |
65 | | - "prefix": "abstract class", |
| 64 | + "scope": "ql", |
| 65 | + "prefix": "abstract class", |
66 | 66 | "body": [ |
67 | 67 | "abstract class ${1:AdditionalThing} extends ${2:DataFlow::Node} {", |
68 | 68 | " abstract ${3:DataFlow::Node} ${4:getThing}($5);", |
|
72 | 72 | }, |
73 | 73 |
|
74 | 74 | "Class::Range": { |
75 | | - "scope": "ql", |
76 | | - "prefix": "range class", |
| 75 | + "scope": "ql", |
| 76 | + "prefix": "range class", |
77 | 77 | "body": [ |
78 | 78 | "class ${1:MyClass} extends ${2:DataFlow::Node} {", |
79 | 79 | " $1::Range range;", |
|
93 | 93 | }, |
94 | 94 |
|
95 | 95 | "Class::Range delegate": { |
96 | | - "scope": "ql", |
97 | | - "prefix": "range delegate", |
| 96 | + "scope": "ql", |
| 97 | + "prefix": "range delegate", |
98 | 98 | "body": [ |
99 | 99 | "${1:DataFlow::Node} ${2:getThing}() { result = range.$2() }" |
100 | 100 | ], |
101 | 101 | "description": "Predicate that delegates to range class", |
102 | 102 | }, |
103 | 103 |
|
104 | 104 | "Type tracking predicate": { |
105 | | - "scope": "ql", |
106 | | - "prefix": "type tracking", |
| 105 | + "scope": "ql", |
| 106 | + "prefix": "type tracking", |
107 | 107 | "body": [ |
108 | 108 | "/** Gets a reference to a ${3:thing}. */", |
109 | 109 | "private DataFlow::Node ${1:myType}(DataFlow::TypeTracker t) {", |
|
124 | 124 | }, |
125 | 125 |
|
126 | 126 | "Type tracking module": { |
127 | | - "scope": "ql", |
128 | | - "prefix": "type tracking module", |
| 127 | + "scope": "ql", |
| 128 | + "prefix": "type tracking module", |
129 | 129 | "body": [ |
130 | 130 | "// ---------------------------------------------------------------------------", |
131 | 131 | "// ${1:modulename}", |
|
189 | 189 | }, |
190 | 190 |
|
191 | 191 | "Type tracking module member": { |
192 | | - "scope": "ql", |
193 | | - "prefix": "type tracking module member", |
| 192 | + "scope": "ql", |
| 193 | + "prefix": "type tracking module member", |
194 | 194 | "body": [ |
195 | 195 | "/** Gets a reference to the `${1:module}.${2:member}` ${3:object/class}. */", |
196 | 196 | "private DataFlow::Node ${4:$2}(DataFlow::TypeTracker t) {", |
|
210 | 210 | }, |
211 | 211 |
|
212 | 212 | "Taint tracking configuration": { |
213 | | - "scope": "ql", |
214 | | - "prefix": "taint tracking", |
| 213 | + "scope": "ql", |
| 214 | + "prefix": "taint tracking", |
215 | 215 | "body": [ |
216 | 216 | "/** @kind path-problem */", |
217 | 217 | "import python", |
|
239 | 239 | }, |
240 | 240 |
|
241 | 241 | "Type tracking submodule": { |
242 | | - "scope": "ql", |
243 | | - "prefix": "type tracking submodule", |
| 242 | + "scope": "ql", |
| 243 | + "prefix": "type tracking submodule", |
244 | 244 | "body": [ |
245 | 245 | " // -------------------------------------------------------------------------", |
246 | 246 | " // ${1:parent}.${2:submodule}", |
|
295 | 295 | }, |
296 | 296 |
|
297 | 297 | "Type tracking class": { |
298 | | - "scope": "ql", |
299 | | - "prefix": "type tracking class", |
| 298 | + "scope": "ql", |
| 299 | + "prefix": "type tracking class", |
300 | 300 | "body": [ |
301 | 301 | " /**", |
302 | 302 | " * Provides models for the `${1:module}.${2:classname}` class", |
|
0 commit comments