What steps are required to create syntax colouring etc for a new language
Hi,
Now that you've got excellent syntax colouring and general support for HTML/JS/CSS, what would it take to create something for ColdFusion markup language (CFML) and make IDEA my ONLY editor? :)
Initially I'm only looking for it to help complete attributes of tags, parameters for functions, and general syntax colouring (i.e. NOT full blown understanding and analysis of the language itself).
What would I need to do?
Many thanks
Ben
Please sign in to leave a comment.
Ben Catherall wrote:
You have no choice but to implement "full blown understanding and
analysis of the language" if you want an IDEA plugin. You provide IDEA
with a lexer, parser, a reference resolution algorithm, and a bunch of
other stuff, and it provides you with an editor with completion and all
that stuff.
It's a pretty serious task, but it's not difficult if you're a little
familiar with lexing and parsing and the concept of an AST. I have a
pretty good editor for a custom data structure definition language in
only 4,500 lines of code, only about a few days of work.
Hi Keith,
What if all you want to do is merge two existing well known syntax colorings like XML and Javascript?
Laszlo has a language that would be well colored just by assigning the .lzx extention to be exactly like xml, but with anything in a CData to be colored as Javascript.
Would that be a simpler process?
Thanks.
-Cort
Cortlandt Winters wrote:
Unfortunately I think this is near impossible with the current API. I would very
much like this kind of functionality.
Hi Keith,
Thanks for the response. Though it's too bad that this isn't easy to do, knowing that it is not easy to do is better than an evening of flailing searches.
Thanks,
-Cort
Cortlandt Winters wrote:
You should vote for http://www.jetbrains.net/jira/browse/IDEABKL-3328
I have the same problem: I'm using Macromedia Flex, Actionscript 2.0, and JHTML. There are no modes for any of these in IntelliJ, and it doesn't sound like it's simple to add them.
The good news is, you can use jEdit instead. jEdit has a single XML file that defines the semantics of each language, and it can change to different langages when it comes across a specific token.
Will.