[prev in list] [next in list] [prev in thread] [next in thread]
List: jedit-devel
Subject: [ jEdit-devel ] Proper use of TokenMarker and LineContext
From: Makarius <makarius () sketis ! net>
Date: 2010-08-24 21:34:00
Message-ID: alpine.LNX.1.10.1008242314530.17618 () atbroy100 ! informatik ! tu-muenchen ! de
[Download RAW message or body]
Dear jEdit experts,
we are am working on a sophisticated plugin where jEdit buffers are
associated with full semantic models provided by an external process.
(The application is to do real-time checking of formal mathematical proof
documents with the Isabelle/Isar theorem prover, e.g. see
http://www4.in.tum.de/~wenzelm/papers/async-isabelle-scala.pdf)
One of the questions arising here is how to connect to the TokenMarker
setup properly. Our own buffer model already provides the full
information for text regions, we only need the absolute text range to map
that to token markup.
TokenMarker.markTokens only provides the current line segment, not its
offset in the buffer text. As a workaround we have experimented with a
LineContext containing the last line as explicit integer. After
investigating memory profiles of jvisualvm and the jEdit sources, it seems
that this is not the proper way to do it. LineContext maintains a
persistent table of all contexts ever encountered, via the "intern"
method. Thus we essentially have a memory leak in our token marker.
Anyway, is this going in the right direction at all? Are there better
ways to modify text styles according to precomputed tables that we have?
I have tried to understand the general TokenMarker, LineContext,
ChunkCache setup, without really seeing through all that.
It would be also nice if the Byte indexes into the SyntaxStyle array could
be side-stepped, i.e. by providing style objects directly. But that is a
different story ...
Makarius
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
--
-----------------------------------------------
jEdit Developers' List
jEdit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic