Can I configure IntelliJ Idea to recognize custom code folding regions designation? - intellij-idea

I like c# #region...#endregion facility a lot (some people say that's a bad habit but let's not discuss that). I miss it a lot when coding other languages. The obvious way to "add" it to other languages is to use special-formed comments the editor would understand. I've managed to set up Kate to support //#region...//#endregion for Java/Scala code, alike feature is not a problem to achieve with NetBeans (here is how). Can I do this with IntelliJ Idea 11?

This feature is planned for IDEA 11.1 that will be released in late Q1, 2012:
IntelliJ IDEA 11.1 will support custom folding using NetBeans and
Visual Studio style comments.

Meanwhile this feature is implemented in IntelliJ IDEA and described here:
http://www.jetbrains.com/idea/webhelp/folding-custom-regions-with-line-comments.html
You can define code regions using two styles:
VisualStudio style
#region Description
Your code goes here...
#endregion
NetBeans style
// <editor-fold desc="Description">
Your code goes here...
// </editor-fold>
But it is recommended to not mix up the two styles in one file. IntelliJ IDEA will recognize the first folding comment encountered, and will assume this as a style chosen for the code.

Related

Why doesn't rearrange code work in Kotlin files in Intellij?

I love Jetbrain's Idea IDE and its ergonomics. One of my favorite tools is idea's rearrange code 'action'(you can bring it up by hitting ctrl+shift+a). It rearranges the code in the java file to put methods in alphabetical order and order the fields in an organized fashion that the user defines. For whatever reason, it doesn't work with Jetbrain's own language, kotlin :(. This sucks even more with the fact that kotlin quickfixes the fields right above the method instead of the beginning of the file like most java files. When is Idea going to support rearrange code for kotlin files?
The reason why the feature does not work is simple: because it has not been implemented. IntelliJ's current Java support feature set has been developed over more than 15 years, and replicating all of Java support features in a new language plugin takes time. We're prioritizing features in the Kotlin plugin for IntelliJ IDEA based on user feedback and language evolution requirements, and so far we haven't seen an indication that code rearranging is in high demand.
Specifically the issue of placing properties by the Create from Usage fix can be fixed with relatively little effort, and doesn't require a full rearrange implementation. I've filed an issue for it.

Maxscript in any jetbrais IDE?

there is currently maxscript programming support inside sublime text.
I was wondering bacause now the syntax highlighting and everything alreay exists for maxscript, how to go about it to make maxscript a supported programming language inside other ide's or editors?
The jetbrains applications comes to mind first (webstorm etc.)
or even inside open online IDE's like Ace of Codemirror.
Because that would be great.
Does anyone knows if that is at all possible, and how to do that?
None of JetBrains IDEs provide support for maxscript:(, and I'm not aware of any custom plugins for this language.
If all you need is a basic syntax highlighting, you can either try searching for MaxSript textmate bundles (see Is it possible to get Ruby syntax highlighting in PHPStorm?) or register your own file type, defining a syntax highlighting for it (http://www.jetbrains.com/webstorm/webhelp/new-file-type.html).
If none of these options look suitable for you, try developing your own language plugins - see http://confluence.jetbrains.com/display/IDEADEV/Developing+Custom+Language+Plugins+for+IntelliJ+IDEA
I would recommend Microsoft Visual Studio Code with MaxScript syntax plugin. The syntax highlighting and overall coding experience is close to perfect.
Example of MaxScript syntax highlighting you may see here:

an objc syntax highlighting library that supports multiple language?

I come from the ruby and python worlds where we have many libraries that can syntax highlight arbitrary code from many languages. I am looking for something similar in the objc ecosystem, but i can't seem to find such, is there one available?
The equivalent libraries in Ruby would be CodeRay and Pygments for Python,
thanks in advance!
Banister,
I myself have searched for a long time for a nice and robust Cocoa Syntax Highlighter, and since I'm currently building a code-oriented text editor myself, that would be a major part of the project.
So, I found out that there are plenty of Objective-C/Cocoa -friendly Syntax Highlighting libraries/components. For a starter (for something relatively basic, that is), I would suggest you have a look at :
OkudaKit (using CSS for styling)
UKSyntaxColoredTextDocument by Uli Kusterer (pretty nice try)
However, if you really need something POWERFUL, well-tested and still Cocoa-friendly, I would definitely suggest you to try the Scintilla component (for Cocoa). The code is great, and the community (at Scintilla-Interest Group) will gladly help you iron out any issues you may encounter.
In a few words :
I'm currently using on an about-to-be-release big project and it's working beautifully for me.
Scintilla
Scintilla is a free library that provides text-editing functions, with
an emphasis on advanced features for source code editing. SciTE
(cross-platform), Geany, Notepad++ (Windows), and Notepad2 (Windows)
are examples of standalone editors based on Scintilla.
Scintilla Editing Component in use (SciTe)
Features
Scintilla supports many features to make code editing easier in
addition to syntax highlighting. The highlighting method allows the
use of different fonts, colors, styles and background colors, and is
not limited to fixed-width fonts. The control supports error
indicators, line numbering in the margin, as well as line markers such
as code breakpoints. Other features such as code folding and
autocompletion can be added.
Download Scintilla (the Cocoa support has been integrated in the main project) : http://www.scintilla.org/SciTEDownload.html
Example project (integrating Scintilla with Cocoa) :
http://bazaar.launchpad.net/~mike-lischke/scintilla-cocoa/trunk/files/head:/cocoa/ScintillaTest/
For complete documentation, have a look at : Scintilla
Documentation
Fragaria may be useful for future reference.

Develop a plugin editor for eclipse

I have a question for you. My teacher proposed a couple of thesis to me. Basically to develop a plugin for eclipse. There are 2 options:
1)An editor for A-SPL language with syntax highlighting, auto completation of the cose, errors detection and so on........to help people that need to use S-APL
2)An editor to help people to design GUI in S-APL......something like a framework where you can drag widgets and there is a kind of automatic completation of the code....
The thesis should last 4 months......i should not implement everything but make a kind of prototype that maybe in the future someone will finish and make properly work.
I never did something like this so i would like to know if it is difficult, which skills are needed, which languages i should know to create eclipse plugins (for example i know java and python) and so on......to figure out if it is something i can do.
I'd suggest to look into the Xtext (for a textual editor) and Graphiti (for a graphical editor) projects.
You'll need Java for Eclipse plugins.
You need to read a book / the eclipse plugin wiki about Eclipse architecture as it's critical to know the paradigms in use.
There's an example XML plugin editor that you can create from the 'New Plugin' wizard which would be a good starting point for the first option.
good luck. :)

SQL code editor with syntax highlighing, auto-formatting and code folding

Is there any SQL editor that supports syntax highlighting, automatic code formatting and code folding? I found this, but it's an Eclipse plugin (I'm a NetBeans user), and cannot automatically format code, which is the most important feature I'm after.
Autocompletion is not important, nor is the possibility of running the code (like the SQL editor in NetBeans).
Edit: I'm sorry for not specifying, I'm looking for Linux or even web-based software.
SQuirreL ticks a lot of your boxes, and has formatting and other plugins and runs on Linux
I'd give it a try at least
Programmers Notepad is a nice little application.
Online SQL Formater http://sqlserverlearner.com/online-tools/tsql-code-formatter
Use VIM.
See this link on how to set it up:
http://www.faqs.org/docs/Linux-HOWTO/Vim-HOWTO.html
Take a look at QweryBuilder. It supports syntax highlighting, automatic code formatting, code folding and auto completion.