Just to give a little context, my use case is to open Orion on a
file then attach a Firebug tracker that applies the source edits to
the live program incrementally. The tracker for each file type is
different, but it's not a syntax highlighter.
jjb
On 6/10/2011 7:48 AM, Mark MacDonald wrote:
In the full-blown Orion platform, you can use the "orion.edit.highlighter" extension point to
contribute new syntax highlighting. There's an example in org.eclipse.orion.client.core/web/plugins/webEditingPlugin.html,
where HTML highlighting rules are contributed.
At the moment the contribution mechanism only accepts syntax
highlighting rules based on a TextMate-style grammar written in
JSON. (see htmlGrammar.js for
example).
You can't contribute a _javascript_-based styler like our current
TextStyler (used for .js/.java/.css).
I opened Bug
349044 for this..
Mark
Mike Wilson---06/10/2011 10:16:39 AM---Pointer
to the "various extension points"? McQ.
From: Mike
Wilson/Ottawa/IBM@IBMCA
To: Orion
developer discussions <orion-dev@xxxxxxxxxxx>
Date: 06/10/2011
10:16 AM
Subject: Re:
[orion-dev] onInputChange: how are file types decided?
Sent by: orion-dev-bounces@xxxxxxxxxxx
Pointer to the "various extension points"?
McQ.
Susan Franklin McCourt ---2011/06/10
10:04:26---In the mainstream code, there are various extension
points that control how styling is done, what editor is opened
for a filety
In the mainstream code, there are various extension points that
control how styling is done, what editor is opened for a
filetype, etc. etc.
But these examples are trying to show the editor being used
independent of all those services and the Orion platform.
Hence the "poor man's" file typing. We specifically don't want
to reuse the orion client code for these example (though from
previous comments John has made, his use case is a bit different
than this one).
susan
Mike Wilson ---06/09/2011 10:57:44 AM---Is it platform
code, or a pluggable service? Either way, we definitely don't
want multiple copies of
From: Mike Wilson
<Mike_Wilson@xxxxxxxxxx>
To: Orion developer discussions
<orion-dev@xxxxxxxxxxx>
Date: 06/09/2011 10:57 AM
Subject: Re: [orion-dev] onInputChange:
how are file types decided?
Sent by: orion-dev-bounces@xxxxxxxxxxx
Is it platform code, or a pluggable service? Either way, we
definitely don't want multiple copies of that code floating
around.
McQ.
"John J. Barton" ---2011/06/09
11:48:27---I accidentally stumbled on the answer in
examples/editor/embeddededitor:
I accidentally stumbled on the answer in
examples/editor/embeddededitor:
if (fileName) {
var splits = fileName.split(".");
var extension = splits.pop().toLowerCase();
if (splits.length > 0) {
switch(extension) {
case "js":
this.styler = new
examples.textview.TextStyler(editorWidget, "js");
break;
case "java":
this.styler = new
examples.textview.TextStyler(editorWidget, "java");
break;
case "css":
this.styler = new
examples.textview.TextStyler(editorWidget, "css");
break;
case "html":
this.styler = new
orion.editor.TextMateStyler(editorWidget,
orion.editor.HtmlGrammar.grammar);
break;
}
}
}
This should be a platform call so we call get the same answer
and don't
dupe code.
jjb
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev
|