Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

coffeescript-react (.cjsx) Support in Webstorm

Is there a way to get any kind of syntax highlighting for .cjsx (jsx in coffeescript) files in WebStorm?

Currently, I'm using a Sublime plugin, which is great, but I'd prefer to stay in WebStorm if possible. I understand WebStorm supports TextMate bundles, so that may be a viable option but I couldn't find one for cjsx.

like image 429
burtyish Avatar asked Dec 31 '14 21:12

burtyish


People also ask

How do I use CoffeeScript in WebStorm?

With WebStorm, you can use CoffeeScript that compiles into JavaScript. WebStorm recognizes *.coffee files and marks them with . You can set breakpoints directly in your CoffeeScript code and WebStorm recognizes them using source maps generated during compilation.

How do I jump between React components in WebStorm?

Besides the basic navigation, WebStorm helps you jump between React-specific code elements. To jump to the definition of a method or a JavaScript expression inside curly braces {}, select the method or expression and press Ctrl+B. To jump to the definition of a component, select the component name and press Ctrl+B.

How do I debug CoffeeScript code?

JavaScript and source maps are generated by compiling the CoffeeScript code manually using the File Watcher of the type CoffeeScript. After that you can debug the output JavaScript code as if it were a Node.js application. Debugging CoffeeScript is supported only in the local mode.

How do I create a typescript project in WebStorm?

When creating an application, select the folder where the create-react-app package is stored. To use TSX instead of JSX, select the Create TypeScript project checkbox. WebStorm will generate .tsx files for your application and a tsconfig.json configuration file.


2 Answers

Atom, the hackable editor, written in coffeescript, has great support for cjsx. (yes, look at that, another really, really, really large project using coffeescript)

I'm using the community (a really, really large community) supported package cjsx-language https://atom.io/packages/language-cjsx

I've almost broken the $1200 chain of IntelliJ. Here is a gist of my atom setup and packages: https://gist.github.com/littlebee/34a60734de79f6f78c56

This was saved by this genius little package: https://atom.io/packages/sync-settings. It wont let you backup to my gist without a key but it might let you restore from it.

like image 78
Bee Wilkerson Avatar answered Sep 22 '22 14:09

Bee Wilkerson


Use this textmate bundle (meant for webstorm cjsx): https://github.com/ruswerner/cjsx.tmbundle

like image 26
Tyler Collier Avatar answered Sep 23 '22 14:09

Tyler Collier