[Lazarus] logic bug in many (or most) TSynEdit

ik idokan at gmail.com
Fri Jun 4 14:32:30 CEST 2010


Zitat von ik <idokan at gmail.com>:

> Hello List,
>
> I've started last week to work on a Syntax highlighter for the Ruby language
> for SynEdit.
> You can find it here: http://github.com/ik5/SynEdit-syntaxes .
>
> I have many things I do not understand in the highlighter issue.
> For example how to create the ident (I've looked at the sources of other
> languages, yet I do not understand how it's been done).

What do you mean with "ident"?


> This is one of the things I require help at the moment to understand.
>
> How do I make the folding issues ?

See TSynPasSyn. Search for everything containing the word "fold".
Basically:
- define an enum for every fold block type (see TPascalCodeFoldBlockType).
- define a range class (for example TSynRubySynRange, you can copy  
TSynPasSynRange and rename all Pas in Ruby). The range class is needed  
to store the code fold state for every line of synedit. (all lines  
with the same state share the same range object).
Martin, maybe some parts can be moved to a TSynCustomHighlighterFoldedRange?
- then see all overrides in TSynPasSyn. I guess Ruby will do many  
things similar, just with other enums and keywords.

Maybe Martin can give a small paragraph, how the store/restore of code  
fold ranges work. Then we can put that all together and put into a  
wiki page.


> And the list goes on (I'll ask it when I'll need to implement it, when I do
> not understand).
>
> This beginning of working for it, started because I think Lazarus is a great
> IDE, and it should support additional programming languages (For now non GUI
> development). Because I use Ruby a lot, and we do not have any Syntax
> Highlighter for it, I decided to try and make Lazarus to support Ruby at
> first.

Great.


> If any of you think also that Lazarus should support additional languages as
> part of the IDE (not only the coloring of the syntax that is), I will be
> glad if people will help me in this manner.

Yes.
I already started a few things. For example you can register your own  
identifier completion. I plan to support other compilers too.


Mattias







More information about the Lazarus mailing list