Today came the first version of the plugin for IntelliJ IDEA - Camelcade. The plugin adds Perl5 support to this wonderful IDE. The plugin is free and open-source. He currently works at IntelliJ IDEA and JetBrains specialized IDEs.

More information about the plugin, see under the cut.
')
Prehistory
I am a programmer with a long experience and diverse experience. A long time ago I have been writing on Perl5 and until recently I wrote in NP ++ (hard to believe). At some point, I wanted more, but there was nothing suitable. Samples of what is showed that everything is bad:
- Sublime is just NP ++ with autocomplete.
- Eclipse + EPIC - permanent bugs with the launch, or installation. I personally got more problems than good.
- Padre is a great undertaking, but abandoned and also extremely unstable. Departures, hangs associated with the UI part of wxWidgets.
- Komodo - the best of what it was. But, the feeling that the Perl5 direction is not developing and what is there, quickly ceased to satisfy. Appetite came with eating.
- Vim - sorry, not mine. Windows child and all that.
In addition to good support, Perl5 wanted to be able to extend the functionality, since You have to work with projects running on custom engines with custom template engines (and yes, you can certainly do this in Vim).
For a while, I had to work on tasks in Python and, accordingly, in PyCharm. It was just great. The best IDE I've ever seen. Hence the decision to try to write a plugin to support Perl5. I didn't know Java at all at all ...
... there may be a detailed essay on the topic “How it was”, which I could state if it would be interesting ...
Total
The first version of the plugin provides the following features:
- Creating a Perl5 Module and Choosing a Perl5 Interpreter
- Parsing Perl5 (without source-filters), POD, Mojolicious templates and Embedded Perl (It's like php with only Perl5 inside)
- Syntax highlighting
- Highlighting and adding brackets, quotes, delimiters for regular expressions.
- Interpolation of strings, here-docs and regular expressions
- Auto-complete for functions, methods, packages, constants and variables
- Transition for functions, variables, classes and constants (Go to symbol / class)
- View file structure and class hierarchy (Structure view / Hierarchy view)
- DFS / C3 inheritance support
- Support for importing functions and variables
- Navigation and refactoring for functions, constants, globs, packages, namespaces, lexical and global variables
- Allow AUTOLOADed Methods
- File templates for scripts, packages and Mojolicious templates.
- Templates (Live templates) for compound constructions (eat extra brackets, Komodo)
- Support for declaring global variables through use vars
- Here-doc refactoring
- IntelliLang support for here-doc and automatic injection of another language depending on the text of the marker
- Annotations for the functions: # @ deprecated, # @ method, # @ returns (the latter is necessary for the correct resolution of the return value type)
- Abstract for neymspeysov: # @ deprecated
- Support for variable typing when declaring
- Intentions: converting string to here-doc
- Inspections:
- Packages: missing package file, unknown namespace, multiple namespace declaration, intersection with core namespace, missing strict / warnings.
- Functions: deprecated, unknown function, multiple definitions, fashion call (new Foo :: Bar), unused functions / constants / globs.
- Variables: unused variables, undefined variables, shading a variable, declaring a built-in variable as lexical or global.
- Extension point for package processors. Allows you to describe the functionality of non-standard modules. For example, Mojo :: Base, which is both strict, and warnings, and base and feature.
Everything is not perfect and most likely will be finished. Made the necessary work for a minimum. More details can be found on the project wiki:
github.com/hurricup/Perl5-IDEA/wikiThanks
- JetBrains for a wonderful IDE and a no less wonderful development platform. It was a very interesting adventure.
- JetBrains employees and especially Peter Gromov for help and tips on the forum, which are so necessary at the start.
- Habra-user VISTALL for valuable advice and code review.
- To the creator of the Erlang plugin, which was often used as a sample.
- To everyone who sent their feedback and feature quest.
Plans
Here you can write a lot of things, because for each implemented feature two new ideas were born. All the moves are recorded, but the further fate of the plug-in will depend on a lot of different factors. Conceptually planned:
- Improved parser (especially error-recovery).
- Improvement of already implemented functionality.
- Performance optimization
- Writing tests.
- Integration with well-known Perl5 frameworks and template engines.
- Integration with PerlBrew.
- Integration with libraries like PerlTidy, PerlCritic, CPAN.
- Debagger.
- Perl6. I was going to start with him precisely because of the presence of formal grammar. But there were arguments against: I don’t know the language at all, it hasn’t come out yet (although it is just about), its performance at the moment leaves much to be desired. But, why not?
Links