├── .gitignore
├── images
├── 1.jpg
├── 2.jpg
└── 3.gif
├── src
└── com
│ └── jinsihou
│ └── react
│ └── snippets
│ └── ReactTemplateProvider.java
├── LICENSE
├── resources
├── META-INF
│ └── plugin.xml
└── liveTemplates
│ └── React.xml
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | out
3 | *.jar
4 |
--------------------------------------------------------------------------------
/images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jinsihou19/ReactSnippets/HEAD/images/1.jpg
--------------------------------------------------------------------------------
/images/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jinsihou19/ReactSnippets/HEAD/images/2.jpg
--------------------------------------------------------------------------------
/images/3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jinsihou19/ReactSnippets/HEAD/images/3.gif
--------------------------------------------------------------------------------
/src/com/jinsihou/react/snippets/ReactTemplateProvider.java:
--------------------------------------------------------------------------------
1 | package com.jinsihou.react.snippets;
2 |
3 |
4 | import com.intellij.codeInsight.template.TemplateActionContext;
5 | import com.intellij.codeInsight.template.TemplateContextType;
6 | import org.jetbrains.annotations.NotNull;
7 |
8 | /**
9 | * @author jinsihou
10 | * @date 2017/10/18
11 | */
12 | public class ReactTemplateProvider extends TemplateContextType {
13 | protected ReactTemplateProvider() {
14 | super("REACT", "React");
15 | }
16 |
17 | @Override
18 | public boolean isInContext(@NotNull TemplateActionContext templateActionContext) {
19 | String name = templateActionContext.getFile().getName();
20 | return name.endsWith(".js") || name.endsWith(".jsx") || name.endsWith(".html") || name.endsWith(".ts");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 jinsihou19
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.
22 |
--------------------------------------------------------------------------------
/resources/META-INF/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 | com.jinsihou.react.snippets
3 | React snippets
4 | 1.1.1
5 | jinsihou
6 |
7 |
9 | Show details in Preferences -> Editor -> Live Templates -> React Group.
10 | ]]>
11 |
12 | v1.1.1
14 |
Migrate deprecated APIs to support hot deployment
15 | v1.1.0
16 |
Supported react 16.8.0 hooks
17 |
add cref snippet
18 |
add cctx snippet
19 |
add hoc snippet
20 |
21 | v1.0.0
22 |
Add all the snippets that can be used for prop types.