EDIT: read next reply first [EDIT end]
If for example a Token has an Error it sets a Markup (red wave underline) to the editor at the position and size of the token. Therefore i need to know the corresponding SynEdit.
The wrong way round, the editor/markup should call the highligter to get the info.
I am also not sure, if this kind of work should be done entirely in the HL (eg. when it affects another file), or should be done in other classes (such as markup)
Worst case, you can use the "SendHighlightChanged" see other post).
---------------------------
To start with:
How does the HL deal with, it affects another editor. Let me go to a pascal example:
var
globalFoo: integer;
.... 1000 lines....
bar(globalFoo);
If you edit "globalFoo: integer;" into "MyGlobalFoo: integer;"
Then a 1000 lines later there is an error.
Yet, if correctly implemented, a highlighter should in such a case only scan the ONE line you edited. This is the one of the most important parts of the design of the HL.
If you store the list of current know var on the "range", then all ranges after this line change, and all file gets scanned.
Well that will work, but is again not how it is designed. And potentially slow (do that on top of a 300.000 lines file.)
Such checks should be done on idle.
Also if you do that, you use a lot of extra mem. And remember currently "range" objects are kept forever (never destroyed) because by design they are re-usable. (all HL have a finite number of such objects / your concept creates an infinite number)
-------------------------
There are events that tell you in which line edit actions, or hl scans took place. (see other mail).
So you can keep list of variable, etc. And any bigger scans, can the run OnIdle.
Then the markup, simple checks, if an identifier is in any of the lists available. This info can be cached for all visible lines.