coffeescript-react (.cjsx) Support in Webstorm - coffeescript

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.

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.

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

I would advice against using CoffeeScript in WebStorm for large projects (see comments section). If you really need to, then you can always use backticks to tell the CoffeeScript compiler to skip the code within the backticks.
render: () ->
return `<div>Hi</div>`;
WebStorm will highlight this just fine if in Settings you select "JSX Harmony" as in the Javascript settings. Now let these cjsx files compile in 2 steps: CoffeeScript -> JavaScript with JSX, then JavaScript with JSX -> JavaScript. If you're using Webpack, it's as simple as:
{include: /\.cjsx$/, loaders: ["coffee-loader", "jsx-loader"]}

Related

VS Code formatting plugins

Is there a way in VS Code to format code according to the style that a person prefers? I guess there might be a plugin for this sort of thing but I've not found that.
For example, I prefer 'K&R' coding style while a colleague prefers 'Whitesmiths' style. When we share code or functions it would be nice to autoformat code into the style that each prefers.
This does not seem like it should be so difficult for a plugin to do except that coding style also has to parse the language of the code, so Whitesmiths PowerShell is going to be different from Whitesmiths on Perl I would imagine.
Are there any plugins like this (or internal functionality in VS Code - it's a very comprehensive tool without installing any plugins of course!) that people use regularly like this?
In contrast to its name, "JIndent" (commercial) is a tool I've been using for the exact purpose you're asking about.

How do TextMate grammars and themes work with VSCode?

VSCode is built on top of MonacoEditor which doesn't support Textmate grammars and themes. But somehow VSCode made it possible. I am curious how VSCode is able to do this.
I am asking because I am making a code editor (based on Monaco) with TextMate grammar and theme support. But I am unable to understand how I can achieve it.
Though there are packages like monaco-textmate to make TextMate grammars work with Monaco, syntax highlighting is still not working properly.
TextMate grammars depend on a particular regex implementation / library called Oniguruma, which is implemented in C. Monaco however is designed to run in the browser, and the JavaScript regex engine available there is not compatible with Oniguruma. All of this is explained in detail in the "Why doesn't the editor support TextMate grammars?" section of Monaco's FAQ. It also mentions the possibiliy of perhaps eventually compiling Oniguruma to WebAssembly to work around this.
VSCode itself uses vscode-textmate for its TMLanguage handling, which has the Oniguruma library as a native dependency. VSCode can have native dependencies because it doesn't run in a browser environment.
According to monaco-textmate's readme, it is actually heavily based on vscode-textmate:
99% of the code in this repository is extracted straight from vscode-textmate
And it does use the WASM approach mentioned earlier:
monaco-textmate relies on onigasm package to provide oniguruma regex engine in browsers. onigasm itself relies on WebAssembly.
As to why syntax highlighting doesn't always work as expected with monaco-textmate... I have no idea, I expect this is simply a bug in the implementation. Perhaps wait for a response from the maintainer, the issue you linked is fairly new.
At least conceptually there shouldn't be a reason why it couldn't achieve the same syntax highlighting VSCode does, since it uses the same regex flavour.

How to add Syntax highlighting for .Vue files in Eclipse

I just want to ask if you know how to add syntax highlighting for vue files using vue-loader. I'm using Eclipse Neon
vue is mostly tags and javascript so treating it as a HTML file would be fair enough. That can be set in eclipse for *.vue under HTML in content type.
There is a plugin in the Marketplace that might be what you're looking for. It's called CodeMix CI 1. I just installed it and aside from adding syntax highlighting, it also does code completion, which comes really handy.

Is there any text editor for Mac that can be configured to have, or already has, autocomplete for Lua?

I know TextWrangler shows the option, but it doesn't actually do anything. So what I want is autocomplete, either with a key combination, or while I type.
Syntax coloring/highlighting is a requirement as well, though I know Xcode and TextWrangler have that.
You might want to use Lua Development Tools for this purpose. It has syntax coloring, plus it is doing smart autocomplete, depending on what your actual context is (required modules, ...)
It is an Eclipse Technology project, and it is Open Source! (EPL license).
Project web page - http://www.eclipse.org/koneki/ldt
Installation via Eclipse Marketplace - http://marketplace.eclipse.org/content/lua-development-tools-koneki
I don't know if you have seen this page, but it seems a good place to start:
http://lua-users.org/wiki/LuaEditorSupport
If I search for "completion" I get:
Decoda (Win)
LuaEdit (Win)
DForD (Win)
NsEditor (Win)
Visual Studio + LuaLite
Eclipse + LuaEclipse or LunarEclipse (java)
I personally use Vim + SuperTab (which only auto-fills with things that you have previously written).
There's a nice plugin for IntelliJ IDEA for Lua. IntelliJ IDEA is really nice, though kind of biggish.
Aside of that there is also TextAdept which is a lot smaller, and 100% configurable in Lua.
And probably a bunch of others.
If you want full (semantic) autocompletion, you should try lua-inspect (source code), which can be installed in the SciTE editor, and also into ViM using vim-lua-inspect.
It uses Metalua to fully parse the source code into AST and then performs code analysis. Apart from simple keyword-based syntax highlighters, it can:
differentiate between local/global variables, parameters and unused variables
jump to the definition of a variable/function
autocomplete table members
correctly rename variables/functions (not only definitions but also uses)
Even though it is not yet stable, and tends to hang on large scripts, it is very usable for standard Lua programs, mainly for it's intelligent autocompletion and renaming.

Any windows based IDE to view objective-c code?

I want to be able to browse through the source code of an iPhone application in windows. I do not want to compile and run the code, just need to have some kind of tool that understands the Objective-C code and iPhone application source structure. Something that view the source code as a whole (project-based) and ideally can link different classes and methods. Something more than just a plain editor with code styling and something less than a full feature IDE. Do you suggest any tools?
Most editors will support Objective-C syntax highlighting. Personally I use VIM or NotePad++. I would recommend NotePad++ for ease of use. But as far as I know there is no 'IDE' for Objective-C for Windows.
I use jEdit if I need to see the source code in Windows. Pretty much handles all the structure and syntax highlighting of objective C.
EDIT: Its an editor. Not a IDE. But with your needs of just viewing code, I guess it must suffice.
If you want a bit more than just syntax highlighting, GNUStep has an IDE called PRoject Center. GNUStep can run on Windows, so allegedly Project Center will too.
Emacs has good syntax and indentation support for Objective-C, for example it can indent the method calls the way Xcode does (based on ':') and there's a Windows version of it available here.
Though it's not an IDE, most of the time I use it for Obj-C/GNUstep without much problems.
If you use something like ctags to tag your source code you could use any editor with support for ctags.
It looks like ctags does not support Objective-C directly, but it is fairly easy to add a new language configuration to ctags.