Skip to content

Commit 1f86640

Browse files
committed
Update readme.md, improve u-suite snippet
1 parent 7636146 commit 1f86640

File tree

3 files changed

+38
-31
lines changed

3 files changed

+38
-31
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,8 @@ Can also be installed using
6767
```bash
6868
ext install uruit-react-snippets
6969
```
70+
71+
## Troubleshooting
72+
If the snippets prefixes do not show up when typing them, make sure you have the tab-completion enabled in your settings: `"editor.tabCompletion": true`.
73+
74+
Alternatively, you can choose *Insert Snippet* in the Command Palette (`Cmd+Shift+P` on Mac, `Ctrl+Shift+P` on Windows or Linux).

package.json

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
{
2-
"name": "uruit-react-snippets",
3-
"displayName": "Uruit React Snippets",
4-
"description": "React Snippets with ECMAScript 6",
5-
"version": "1.1.0",
6-
"publisher": "UruIT",
7-
"icon": "images/uruit-logo.png",
8-
"engines": {
9-
"vscode": "^1.13.0"
10-
},
11-
"categories": [
12-
"Snippets"
13-
],
14-
"homepage": "https://github.com/UruIT/vscode-react-snippets",
15-
"repository": {
16-
"type": "git",
17-
"url": "https://github.com/UruIT/vscode-react-snippets.git"
18-
},
19-
"bugs": {
20-
"url": "https://github.com/UruIT/vscode-react-snippets/issues"
21-
},
22-
"contributes": {
23-
"snippets": [
24-
{
25-
"language": "javascript",
26-
"path": "./snippets/snippets.json"
27-
}
28-
]
29-
}
2+
"name": "uruit-react-snippets",
3+
"displayName": "UruIT React Snippets",
4+
"description": "React Snippets with ECMAScript 6",
5+
"version": "1.1.1",
6+
"publisher": "UruIT",
7+
"icon": "images/uruit-logo.png",
8+
"engines": {
9+
"vscode": "^1.13.0"
10+
},
11+
"categories": ["Snippets"],
12+
"homepage": "https://github.com/UruIT/vscode-react-snippets",
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/UruIT/vscode-react-snippets.git"
16+
},
17+
"bugs": {
18+
"url": "https://github.com/UruIT/vscode-react-snippets/issues"
19+
},
20+
"contributes": {
21+
"snippets": [
22+
{
23+
"language": "javascript",
24+
"path": "./snippets/snippets.json"
25+
}
26+
]
27+
}
3028
}

snippets/snippets.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@
8888
"import renderer from 'react-test-renderer';",
8989
"import { shallow } from 'enzyme';",
9090
"",
91+
"const PROPS = {",
92+
"\t$0",
93+
"}",
94+
"",
9195
"describe('$1', () => {",
9296
"\tit('should render', () => {",
93-
"\t\tconst wrapper = shallow(<$1 />);",
97+
"\t\tconst wrapper = shallow(<$1 {...PROPS} />);",
9498
"\t\texpect(wrapper.find('div').node).toBeTruthy();",
9599
"\t});",
96100
"});"
@@ -245,7 +249,7 @@
245249
"\t}",
246250
"}"
247251
],
248-
"description": "React PropType Any"
252+
"description": "React custom PropType"
249253
},
250254
"PropTypes.CustomArrayProp": {
251255
"prefix": "u-ptcustomarrayof",
@@ -256,7 +260,7 @@
256260
"\t}",
257261
"})"
258262
],
259-
"description": "React PropType Any"
263+
"description": "React PropType CustomArrayOf"
260264
},
261265
"Redux actions": {
262266
"prefix": "u-actions",

0 commit comments

Comments
 (0)