Extend scripted with own language (DSL)

67 views
Skip to first unread message

Richard Brenner

unread,
Jan 18, 2013, 9:03:49 AM1/18/13
to script...@googlegroups.com
Hello,

Is it possible to extend the editor with a DSL to support syntax highlighting and auto-completion for a new language?
We have developed a DSL with xtext and would be interested how difficult it is to extend scripted.

Thanks

Andrew Eisenberg

unread,
Jan 18, 2013, 11:01:25 PM1/18/13
to Richard Brenner, script...@googlegroups.com
Hi Richard,

Short answer: Yes, sort of.

Long answer: For Scripted 0.4.0, we are working on a proper plugin
model. Content assist and syntax highlighting are high on the list
for supporting in a pluggable way.

If you are talking about *only* content assist and syntax
highlighting, then you can have that now, with just a little bit of
hacking. There are plans on making this support more explicit. But
if there are other things you need to do (like navigation, hovers, and
error markers), then there would be a bit more work.

For content assist, have a look at cssContentAssist.js (the simplest
implemented content assistant) and look at the computeProposals
function.And take a look at the other content assistants for

For the grammar and syntax highlighting, take a look at
htmlGrammar.js. The grammar files use a sub-set of text mate styling
to do syntax highlighting. See here for a quick reference:
http://macdevcenter.com/pub/a/mac/2007/04/11/customizing-textmate.html

Both of these are plugged in inside of scriptedEditor.js and these
apis have been borrowed from Eclipse Orion (and the good news is that
if you already have done some Eclipse Orion integration, then this can
largely be ported over as-is). I don't have much experience with the
styling, and don't really know how flexible it is, but the content
assist api is quite flexible and we are planning on making it more so.
As we finalize the plugin model, we will also nail down our api.
(Athough I doubt we would make any incompatible changes.) Your
feedback in this area would be greatly appreciated and would help us
craft better apis. And I am happy to help if you have any more
questions or problems.

--a
> --
>
>

Richard Brenner

unread,
Jan 22, 2013, 6:58:32 AM1/22/13
to script...@googlegroups.com, Richard Brenner
Hi Andrew,

Thank you for the reply and pointing me to the right files.

Richard

Michael Vorburger

unread,
Feb 2, 2013, 8:21:32 AM2/2/13
to script...@googlegroups.com, Richard Brenner
Richard, interesting that you're looking into this.. had similar ideas here.

BTW: You've probably seen http://holgerschill.blogspot.ch/2012/11/xtext-in-web.html ? Not sure how easy it would be to combine this with scripted.

Andrew Eisenberg

unread,
Feb 4, 2013, 12:01:38 PM2/4/13
to Michael Vorburger, script...@googlegroups.com, Richard Brenner
This is the kind of thing that we would like to support in scripted.
I mean, support in terms of exposing the proper plugin extension
points. We are a bit away from that right now. There is no easy way
to configure syntax or semantic highlighting for new languages. And
the other requirements (validation, hovers, and content assist) we are
very close to having a plugin api for them. As I mentioned earlier,
these are the kinds of things that we want sorted out for 0.4.0.
> --
> You received this message because you are subscribed to the Google Groups
> "scripted-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scripted-dev...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Richard Brenner

unread,
Feb 5, 2013, 5:24:59 AM2/5/13
to script...@googlegroups.com, Richard Brenner
Thank you Michael.
I've seen the presentation and a colleague of mine talked to the guy who is working on that on the OOP in Munich, but it seems that this is going to be a commercial product and not open source.
Reply all
Reply to author
Forward
0 new messages