Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] TextMate grammar performance

Hi Mike,

Mark was going to reply and say "don't use the TextMate stuff", but I suggested that I could pass the message along.  For multiple reasons Orion's implementations for using TextMate grammars and CodeMirror modes for syntax highlighting are not adequate for Orion going forward, so I've recently started working on an alternate implementation that is designed for Orion's editor/plug-in separation.  I've logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=421274 to track this effort.

Nothing has been released in this area yet, so there's nothing concrete to point you at.  However having COBOL as an early test language would be very helpful in identifying whether the implementation meets the needs of languages beyond the initial three test cases (js, css and html).  If you CC yourself to the linked report then you will see updates as they become available.

Grant




From:        Mike Kucera/Toronto/IBM@IBMCA
To:        Orion developer discussions <orion-dev@xxxxxxxxxxx>,
Date:        11/06/2013 04:52 PM
Subject:        [orion-dev] TextMate grammar performance
Sent by:        orion-dev-bounces@xxxxxxxxxxx




Thanks for the help with the links. I just wanted to make sure it would be possible to do hyperlinking.

I'm exploring the grammar approach for highlighting cobol because I think it should be easier to handle context sensitivity. Cobol has things like positional keywords, for example SQL keywords should only get highlighted inside of embedded SQL statements.


I have started with a very simple grammar that just matches keywords, strings, numbers and comment blocks. We have a 16,000 line cobol file we use for performance testing. When I use my grammar with this file the editor performance slows down considerably. Whey I type something into the editor it can sometimes take several seconds for what I typed to appear. The performance is much worse when I type something at the top of the file than at the bottom. It seems to want to parse the file from where the cursor is all the way to the bottom.


There's at least three issues here...
- A lot of the time is spent matching regular expressions (according to Chrome dev tools). I'm not sure if there's any way to optimize this.
- It seems to want to parse the whole file below the cursor. From looking at the source for TextMateStyler it seems like there should be a way to get it to only parse a region of the file, but I don't know how to do that.
- The editor runs the styler on every keystroke. If I quickly type 5 characters it calls the styler 5 times. In the regular eclipse editor a background reconciler thread keeps a timer that is reset to zero on every keystroke, and the repair event is only fired after the user has stopped typing for a bit. Can something like that be done in Orion?


Thanks!

Mike Kucera
Rational Developer for AIX and Linux
IBM Toronto Lab
mkucera@xxxxxxxxxx
 
 



Inactive hide details for Mark Macdonald ---11/05/2013 05:16:03 PM---Hi Mike Grammars in Orion currently do not allow hyperlinkMark Macdonald ---11/05/2013 05:16:03 PM---Hi Mike Grammars in Orion currently do not allow hyperlinks to be generated, only

From:
Mark Macdonald <mamacdon@xxxxxxxxx>
To:
Orion developer discussions <orion-dev@xxxxxxxxxxx>
Date:
11/05/2013 05:16 PM
Subject:
Re: [orion-dev] TextMate grammar and hyperlinks
Sent by:
orion-dev-bounces@xxxxxxxxxxx




Hi Mike


Grammars in Orion currently do not allow hyperlinks to be generated, only CSS class names (which are derived from the grammar's "name" rules).


I believe hyperlinks could be contributed by writing an
async highlight provider that produces the appropriate style ranges. A range having this shape would probably work:
{
  tagName: "a",
  attributes: {
    href: "
http://example.org"
  }
  // 'start' and 'end' fields omitted.
  // Ranges produced by an async highlighter must be be bundled inside a
StyleReadyEvent object -- see docs
}


However I have not tested this.


Mark



On Tue, Nov 5, 2013 at 2:03 PM, Mike Kucera <
mkucera@xxxxxxxxxx> wrote:
Hi,

I'm working on a COBOL grammar for use with the orion.editor.TextMateStyler and I have one question: how do I create ctrl-click hyperlinks? I think I need to somehow attach a 'href' attribute to the style object but I don't know how to do that from the grammar.

Thanks.


Mike Kucera
Rational Developer for AIX and Linux
IBM Toronto Lab
mkucera@xxxxxxxxxx
 
 



_______________________________________________
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


Back to the top