Integrate MPS with other JetBrains IDE - intellij-idea

Is it possible to well integrate MPS based DSL other IntelliJ IDEs like PhpStorm?
Most wanted features are handling files by its types (*.ext pattern) and PHP files generation (transparent or at least automatic).

MPS is usable in a restricted form in other IntelliJ platform based IDEs, like WebStorm, PhpStorm.
I don't know of any special support for generating PHP code via MPS, at least MPS team hasn't done it for sure.
Also, answering the question from comments, it is correct to say that programs in DSLs implemented in MPS are by default persisted as xml files. Custom persistence can be implemented as a plugin to MPS. Also, custom persistence can be tailored to a particular DSL, unlike the default xml persistence which is language agnostic.

Related

How to build EMOF models in IntelliJ and generate code from them?

What is the best way to build models in IntelliJ, in the style of Eclipse EMF ?
Is there an equivalent of Eclipse EMF in IntelliJ ?
And is there something that adheres to standards such as EMOF in the same way that EMF Ecore is aligned to it ?
I found a plugin that seems to help with that here, but I am wondering if there are other/better options.
Checkout the Working with Diagrams docs. JetBrains provides UML modeling and supports both forward and reverse engineering. Although this is not EMF, it appears to be IntelliJ's equivalent in terms of functionality.
Note this feature is exclusive to the IJ Ultimate Edition.

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.

Are there any text-editors/IDEs that support languages generically?

I'm looking for an editor/IDE that can provide features that are nice to have while coding (example: being able to click-through to function definitions) for languages that it is not specifically built for. By these, I have in mind languages designed for a very specific purpose and often only used by a small community. In other words, ones that would not have native support in most software.
I realize this would require a fair bit of fairy dust but I don't think it's out of the scope of what's possible. Basically, the editor would have to be smart enough to recognize the commonly used syntax and semantics that many declarative languages have in common. It's quite possible this would require some amount of configuration.
Does something like this exist? If not, what challenges do you think there would be in creating it?
If you need only the feature to jump of to the definition of a specific function or class, then VIM (and many other editors, like Emacs, Epsilon and JOE) can read the jump location from the ctags file. You just have to write a ctags file generator for your custom language.
For programmable editors (like VIM, Emacs, Epsilon, Eclipse and gedit), you can write your own plugin for your custom language, but it may quickly become time-consuming and a maintenance nightmare, because new versions of editors tend to change the plugin interface.
Please note that adding support for syntax highlighting is usually much easier than adding ctags-like support for symbol lookups. More advanced features, like refactoring and context-sensitive symbol completion (like Ctrl-Space and Tab in modern IDEs) are even harder to implement.
GNU Emacs has a pretty good infrastructure for this sort of thing. Until recently Haskell was a relatively unknown language used primarily by researchers. Nevertheless, in a few thousand lines of Emacs Lisp, we have
Syntax highlighting with colors
Automatic indentation
Package support
Automatic highlighting of type and other information when placing the cursor over library functions
Meta-dot on an identifier to jump to its definition (through the standard emacs tags mechanism)
The nice thing about Emacs is that (a) there are many models to follow, and (b) you can build up the environment gradually, starting with those aspects that are most important to you.
I'm suprised no one has mentioned Notepad++ yet:
http://notepad-plus-plus.org/
It offers syntax support for a great many languages and offers the user to add new languages, and an active community that adds many languages that are not included out-of-the-box.
Most good IDE's are language agnostic and supports several if not many programming languages. If you are talking about DSL's, eclipse has a solution that seems pretty awsome - Xtext
EditPadPro comes with a set of tools that allow you to build your own syntax highlighting, code folding and file navigation schemes, based on a very powerful regex syntax. So if your language is not among the many that have already been provided out-of-the-box or can be downloaded off the website, you can roll your own quite easily (and share it with the community).
Visual Studio is designed to allow for this, but it requires the language to add explicit support. For example, Delphi Prism will install into Visual Studio, and provide full language support.
This is far above and beyond "configuration", however, and requires quite a bit of custom development to support.
SciTE and Scintilla offer a generic editor/platform for different languages. The library contains several parsers that work with many programming languages and you can reuse one of these for your own language to add formatting and syntax highlighting.
They don't offer advanced features like click-throughs, but you could build it on top of the library.
Visual Studio and Eclipse also support language plug-ins.
Zeus is a language neutral IDE for the Windows platform and it provides this go to definition/declaration functionality for any language supported by ctags.
To make it work you just create a Zeus project/workspace and then add the files to this workspace.

How to create an Eclipse editor plugin with syntax checking and coloring as fast as possible?

I'm working on a project that requires me to create a series of editors for languages that are quite different. The syntaxes are defined by us.
I'm looking for a solution for this.
Is there a shortcut to take in this problem?
You could use XText:
a framework for development of textual domain specific languages (DSLs).
Just describe your very own DSL using Xtext's simple EBNF grammar language and the generator will create a parser, an AST-meta model (implemented in EMF) as well as a full-featured Eclipse text editor from that.
Alternatives to XText are Rascal or Spoofax, both less popular than XText but interesting for they support more general context-free grammars, among other things. Nice to check out.
If you are looking for a more low level, programmable solution, then Eclipse's IDE Meta-tooling platform is a good choice (IMP).
What IMP gives you is API to connect your existing parsers to Eclipse without much hassle. You need to implement an IParseController interface, to call your parser and ITokenIterator to produce tokens and some other interface to assign fonts to each kind of token.
The aforementioned Rascal and Spoofax are both build on top of IMP.
Not mentioned is DLTK (proposed also in Tutorial regarding the development of a custom Eclipse editor)
There are Ruby, bash that are implemented with it.

Does a language-specific IDE have any advantages over a plugin for a multi-language IDE?

I do mostly Java and C/C++ development, but I'm starting to do more web development (PHP, Rails) and Eiffel (learning a new language is always good).
Currently, I use Eclipse for Java, C/C++, and Ruby (not Rails). Since I know the environment, I'm thinking that it would be easier for me to find a plugin and use Eclipse for all of my development languages. But are there cases where a language-specific IDE (EiffelStudio for Eiffel, as an example) would be better than Eclipse?
I have used many many IDE's and in most cases to me it breaks down to personal preferences. Sometimes the language specific ones have some addins/addons/features that are nice but unless they are things you can not live without you should go with what is most comfortable for you.
I would think that if you are comfortable with the multi-language IDE it would be better to stick with that one. This way you dont have to memorize multiple IDE layouts, keyboard shortcuts etc.
Mastering an IDE takes time and energy. Using a multi-language IDE is definitively beneficial for a programmer who needs to develop in several languages. It is for the same reason that tools like VI and Emacs are so popular.
On the other side, IDE specialized in one language could sometimes go much further on some aspect and could be the preferred choice in some situations.
I love Eclipse as Java IDE (so much that we decided to build some Eclipse based application) and I'm an Emacs fan. But I also like the Groovy support of IntelliJ and the efficiency of EiffelStudio.
It's a matter of taste, you forgive the ones you love...
It entirely depends on the user and the language itself, if you are comfortable with the keyboard shortcuts then you can consider the plugin else you can go for a IDE . However most of the IDE comes with a cross-functional key maps so you use the key maps which u are more comfortable with....