Skip to content

Commit 212fdc6

Browse files
committed
Initial Commit
0 parents  commit 212fdc6

File tree

8 files changed

+244
-0
lines changed

8 files changed

+244
-0
lines changed

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Numerous always-ignore extensions
2+
*.diff
3+
*.err
4+
*.orig
5+
*.log
6+
*.rej
7+
*.swo
8+
*.swp
9+
*.vi
10+
*~
11+
12+
# OS or Editor folders
13+
.DS_Store
14+
._*
15+
Thumbs.db
16+
.cache
17+
.project
18+
.settings
19+
.tmproj
20+
*.esproj
21+
nbproject
22+
*.sublime-project
23+
*.sublime-workspace
24+
25+
# Folders to ignore
26+
.hg
27+
.svn
28+
.CVS
29+
node_modules
30+
bower_components
31+
_temp
32+
.vagrant
33+
id_rsa
34+
deb
35+
*.deb

.vscodeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.gitignore
2+
LICENSE
3+
CHANGELOG.md

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# VS Code OverReact Snippets Changelog
2+
3+
## 1.0.0
4+
- Initial release

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Jace Hensley
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# VS Code OverReact Snippets
2+
-------------------
3+
4+
This extension contains code snippets for [OverReact][over_react].
5+
6+
## Installation
7+
8+
In order to install an extension you need to launch the Command Pallete (Ctrl + Shift + P or Cmd + Shift + P) and type Extensions.
9+
There you have either the option to show the already installed snippets or install new ones.
10+
11+
## Supported languages (file extensions)
12+
* Dart (.dart)
13+
14+
## Snippets
15+
16+
Below is a list of all available snippets and the triggers of each one..
17+
18+
| Trigger | Content |
19+
| -------: | ------- |
20+
| `orStless` | stateless component skeleton |
21+
| `orAbsStless` | abstract stateless component skeleton |
22+
| `orStful` | stateful component skeleton |
23+
| `orAbsStful` | abstract stateful component skeleton |
24+
| `orMixin` | prop mixin skeleton |
25+
26+
[over_react]: https://workiva.github.io/over_react/

images/over_react.png

26.2 KB
Loading

package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "over-react-snippets",
3+
"description": "Code snippets for OverReact development.",
4+
"version": "1.0.0",
5+
"displayName": "OverReact Snippets",
6+
"publisher": "Jace Hensley",
7+
"icon": "images/over_react.png",
8+
"license": "SEE LICENSE IN LICENSE",
9+
"bugs": {
10+
"url": "https://github.com/jacehensley/vscode-over-react-snippets/issues"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/jacehensley/vscode-over-react-snippets"
15+
},
16+
"engines": {
17+
"vscode": "^1.13.0"
18+
},
19+
"categories": [
20+
"Snippets"
21+
],
22+
"keywords": [
23+
"dart",
24+
"dartlang",
25+
"overreact"
26+
],
27+
"contributes": {
28+
"snippets": [
29+
{
30+
"language": "dart",
31+
"path": "./snippets/snippets.json"
32+
}
33+
]
34+
}
35+
}

snippets/snippets.json

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"statelessComponents": {
3+
"prefix": "orStless",
4+
"body": [
5+
"@Factory()",
6+
"UiFactory<${1:MyComponent}Props> ${1:MyComponent};",
7+
"",
8+
"@Props()",
9+
"class ${1:MyComponent}Props extends UiProps {",
10+
"",
11+
"}",
12+
"",
13+
"@Component()",
14+
"class ${1:MyComponent}Component extends UiComponent<${1:MyComponent}Props> {",
15+
"\t@override",
16+
"\tMap getDefaultProps() => (newProps());",
17+
"",
18+
"\t@override",
19+
"\trender() { }",
20+
"}"
21+
],
22+
"description": "Creates a stateless OverReact component"
23+
},
24+
"abstractStatelessComponents": {
25+
"prefix": "orAbsStless",
26+
"body": [
27+
"@AbstractProps()",
28+
"abstract class ${1:MyComponent}Props extends UiProps {",
29+
"",
30+
"}",
31+
"",
32+
"@AbstractComponent()",
33+
"abstract class ${1:MyComponent}Component<T extends ${1:MyComponent}Props> extends UiComponent<T> {",
34+
"\t@override",
35+
"\tMap getDefaultProps() => (newProps());",
36+
"",
37+
"\t@override",
38+
"\trender() { }",
39+
"}"
40+
],
41+
"description": "Creates an abstract stateless OverReact component"
42+
},
43+
"statefulComponents": {
44+
"prefix": "orStful",
45+
"body": [
46+
"@Factory()",
47+
"UiFactory<${1:MyComponent}Props> ${1:MyComponent};",
48+
"",
49+
"@Props()",
50+
"class ${1:MyComponent}Props extends UiProps {",
51+
"",
52+
"}",
53+
"",
54+
"@State()",
55+
"class ${1:MyComponent}State extends UiState {",
56+
"",
57+
"}",
58+
"",
59+
"@Component()",
60+
"class ${1:MyComponent}Component extends UiStatefulComponent<${1:MyComponent}Props, ${1:MyComponent}State> {",
61+
"\t@override",
62+
"\tMap getDefaultProps() => (newProps());",
63+
"",
64+
"\t@override",
65+
"\tMap getInitialState() => (newState());",
66+
"",
67+
"\t@override",
68+
"\trender() { }",
69+
"}"
70+
],
71+
"description": "Creates a stateful OverReact component"
72+
},
73+
"abstractStatefulComponents": {
74+
"prefix": "orAbsStful",
75+
"body": [
76+
"@AbstractProps()",
77+
"abstract class ${1:MyComponent}Props extends UiProps {",
78+
"",
79+
"}",
80+
"",
81+
"@AbstractState()",
82+
"abstract class ${1:MyComponent}State extends UiState {",
83+
"",
84+
"}",
85+
"",
86+
"@AbstractComponent()",
87+
"abstract class ${1:MyComponent}Component<T extends ${1:MyComponent}Props, S extends ${1:MyComponent}State> extends UiStatefulComponent<T, S> {",
88+
"\t@override",
89+
"\tMap getDefaultProps() => (newProps());",
90+
"",
91+
"\t@override",
92+
"\tMap getInitialState() => (newState());",
93+
"",
94+
"\t@override",
95+
"\trender() { }",
96+
"}"
97+
],
98+
"description": "Creates an abstract stateful OverReact component"
99+
},
100+
"propMixins": {
101+
"prefix": "orMixin",
102+
"body": [
103+
"@PropsMixin()",
104+
"abstract class ${1:MyComponent}PropsMixin {",
105+
"\tstatic final ${1:MyComponent}PropsMixinMapView defaultProps = new ${1:MyComponent}PropsMixinMapView({});",
106+
"",
107+
"\tMap get props;",
108+
"}",
109+
"",
110+
"class ${1:MyComponent}PropsMixinMapView extends MapView with ${1:MyComponent}PropsMixin {",
111+
"\t/// The props to be manipulated via the getters/setters.",
112+
"\t///",
113+
"\t/// In this case, it's the current MapView object",
114+
"\t@override",
115+
"\tMap get props => this;",
116+
"}"
117+
],
118+
"description": "Creates an abstract stateful OverReact component"
119+
}
120+
}

0 commit comments

Comments
 (0)