Formatter for Kotlin on IntelliJ - kotlin

I am developing an application using Kotlin and using IntelliJ IDEA as editor. But not sure how to set a pre commit hook to format the code automatically. Could you please guide me on this with some open source formatter and how to use it. Thanks in advance!

You have two aspects:
Commit hooks are here:
Verifiy the that the check box are checked.
Koltin format:

Related

How to avoid the error message when using thymeleaf templates in Intellij

I'm using spring boot and thymeleaf in Intellij Idea and try to get the parameters of the URL in the template, I use the following code:
<!--/*#thymesVar id="param" type="java.util.Map<java.lang.String, java.lang.String>"*/-->
<a th:href="#{/dashboard(version=${param.version})}">Dashboard</a>
It works correctly, but I want to clear the error message, Is there any good way to do this?
This is not an error. If you run your application, It is supposed to work (If there is no other errors), as you mentioned that It's working correctly. The JetBrains/ IntelliJ is not able to locate your model variables with Thymeleaf framework. So that's why I does show the red underline. For more details check the link how to resolve JetBrains model variables.
Hopefully in next version of IntelliJ IDEA, this issue would get resolved.
Let us know If It was helpful.

Intellij idea: how to extend the Java editor

I have managed to develop and run an intellij plugin. Would it be possible to create a plugin extending the java editor for instance by providing a custom code completion feature ?
Yes, this is possible. Please refer to the JavaDoc of the CompletionContributor class for details of implementing custom code completion.

Code assist - Sencha Touch

I am following this tutorial http://vimeo.com/album/1573372/video/37212149
It seems that there is a way to type "xmodel" and have a standard model's code generated automatically. I am using Webstorm IDE - is there a way of doing this in it, and any configurations I can import?
Thanks
Seems 'Live Templates' is the feature you refer to - it allows expanding abbreviations into code snippets. See http://www.jetbrains.com/webstorm/webhelp/live-templates.html, http://davidtucker.net/articles/live-templates-phpstorm-webstorm/
WebStorm doesn't come with predefined live templates for Sencha, but you can easily create them yourself or search the web for existing templates. See ST2 Power Tools, for example

Quick Helper Annotaion in Java Editor

I'm trying to develop a eclipse plugin, which displays a Quick help annotation in the Java Editor.
The Quick Help icon should appear at every place, a type statement is missing in the Java-Code.
I'm a total noob in Eclipse plugin development. I read a few things about it and understand the idea with Extension points but I don't get how to add a annotation in the Eclipse Java editor.
Are there any examples or tutorials available for this problem/topic?
I don't know how to start and appreciate any help or hints.
I finally made it by placing a Marker and specifying a markerResolution for him.
Resources:
Howto add a Marker
,
Marker Customization ,
Adding a Quick Fix to a marker type

How to disable code formatting for some part of the code using comments?

I'd like to selectively disable the IntelliJ IDEA code formatter for a portion of code just like I can in Eclipse. Does IntelliJ support this feature, and if so, how do I use it?
Since version 13 it's possible to wrap the code with
// #formatter:off
...
// #formatter:on
IntelliJ IDEA v.2018+:
File > Settings > Editor > Code Style
IntelliJ IDEA v.2016+:
Preferences > Editor > Code Style
IntelliJ IDEA v.14+:
Preferences > Editor > Code Style > Formatter Control
You can change the formatter control markers, as long as they're in comments.
Ensure formatter markers in comments are enabled, as shown in the following figure:
Note for Carlos' answer of #formatter:off and #formatter:on to work, you may need to enable the preference first:
Discovered via How to config intellij-idea not format some part of the code?
IDEA-56995 Disabled code formatting per region using comments
In xml files, use:
<!-- #formatter:off -->
<!-- #formatter:on -->
Obsolete answer from 2010:
No, it's not possible right now, I've submitted a new issue which you can track.
As a temporary solution you can use external formatter plug-in for IDEA which can utilize Eclipse code formatter (I didn't check whether this particular option is supported).
It's currently not possible to exclude entire files (like regression test data xmls) from formatting. See https://youtrack.jetbrains.com/issue/IDEA-167112