|
1 | 1 | # webstorm-styled-components |
2 | | -React Styled Components Language Support in IntelliJ/Webstorm |
| 2 | +Support for styled-components 💅 in WebStorm |
3 | 3 |
|
4 | | -# Motivation |
5 | | -https://github.com/styled-components/styled-components/issues/176 |
| 4 | +The plugin can be installed in WebStorm, IntelliJ IDEA Ultimate, PhpStorm, PyCharm Pro, and RubyMine v2017.2 and above. |
6 | 5 |
|
7 | 6 | # Installation |
8 | | -An alpha version is here! Here are the steps you need for installations |
9 | | -- Download the latest release from here https://github.com/styled-components/webstorm-styled-components/releases/ |
10 | | -- Extract the archive |
11 | | -- In Webstorm, Hit <kbd>CMD</kbd>+<kbd>SHIFT</kbd>+<kbd>A</kbd> to bring up actions pane. Then select *Add Plugin From Disk* |
| 7 | +To install the plugin: |
| 8 | +- Download the latest [release](https://github.com/styled-components/webstorm-styled-components/releases/) |
| 9 | +- In WebStorm, hit <kbd>Cmd</kbd>/<kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>A</kbd> to bring up the actions pane. Then select *Add Plugin From Disk* |
12 | 10 | - Select `webstorm-styled-components.zip` to install the plugin |
13 | | -- You should find your StyledComponents instances highlighted automatically |
14 | 11 |
|
15 | | -# Known Issues |
16 | | -The plugin only works with Webstorm 2017 |
| 12 | +# Features |
| 13 | +With this plugin you can enjoy the full coding assistance for styled-components 💅 |
17 | 14 |
|
18 | | -# Current Progress |
19 | | - |
| 15 | +- Start typing to get code completion for CSS properties and values |
20 | 16 |
|
21 | | -# TODO |
| 17 | +<img src="https://blog.jetbrains.com/webstorm/files/2017/09/ws-st-comp-css-completion.png" width=680> |
| 18 | + |
| 19 | +- Hit <kbd>Alt</kbd>-<kbd>Enter</kbd> to see available intentions and quick-fixes |
| 20 | + |
| 21 | +<img src="https://blog.jetbrains.com/webstorm/files/2017/09/ws-st-comp-intentions.png" width=680> |
| 22 | + |
| 23 | +- Start typing in the interpolation to see completion suggestions for JavaScript variables, methods and functions |
| 24 | + |
| 25 | +<img src="https://blog.jetbrains.com/webstorm/files/2017/09/ws-st-comp-js-completion.png" width=680> |
| 26 | + |
| 27 | +- Cmd/Ctrl-click on the JavaScript symbol to do to its definition |
| 28 | + |
| 29 | +# Limitations |
| 30 | +- The plugin only works with the JetBrains IDEs version 2017.2 or above. |
| 31 | +- It is not yet available on [JetBrains Plugin Repository](https://plugins.jetbrains.com/). When installing the plugin from disk, you won't get update notifications for it. |
| 32 | +- Semicolons at the end on the line should be outside the string, e.g. `color: ${props => props.primary ? 'white' : 'palevioletred'};` |
| 33 | + |
| 34 | +# Contributing to the plugin |
| 35 | +Please report any issue with the plugin on [GitHub](https://github.com/styled-components/webstorm-styled-components/issues). We welcome your pull requests. |
| 36 | + |
| 37 | +The plugin is written in [Kotlin](https://kotlinlang.org/) and uses [Gradle](https://gradle.org/). |
| 38 | + |
| 39 | +**To start contributing** |
| 40 | +1. Clone this repository. |
| 41 | +2. Open the resulting directory in a recent version of Intellij IDEA (2017.*) using 'Open project'. |
| 42 | +3. In the 'Import Project from Gradle' dialog, accept the default settings. |
| 43 | + |
| 44 | +* To **run tests** use `test` task (from the IDEA UI search for 'Execute Gradle Task' and select `test` or run `./gradlew test` from the command line) |
| 45 | + |
| 46 | +* To **launch IDEA** with the plugin built from your current sources use `runIde` |
| 47 | + |
| 48 | +* To **prepare a zip archive** for deployment use `buildPlugin` |
| 49 | + |
| 50 | +The project structure and dependencies are defined in [build.gradle](https://github.com/styled-components/webstorm-styled-components/blob/master/build.gradle). |
| 51 | + |
| 52 | +**Useful links** |
| 53 | +* [gradle-intellij-plugin](https://github.com/JetBrains/gradle-intellij-plugin) documentation on available Gradle tasks and build.gradle configuration options |
| 54 | +* [IDEA SDK documentation](https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started.html) describes IDEA plugin structure in general |
| 55 | +* [Kotlin language reference](https://kotlinlang.org/docs/reference/) |
| 56 | + |
| 57 | +# Todo |
22 | 58 | - Smart Indentation when opening backticks and pressing enter. |
23 | 59 |
|
24 | 60 | # License (MIT) |
|
0 commit comments