ktexteditor and syntax-highlighting porting

Dominik Haumann dhaumann at kde.org
Sun Jul 29 10:17:06 BST 2018


On Sun, Jul 29, 2018 at 9:53 AM, Dominik Haumann <dhaumann at kde.org> wrote:
> [...]
>
> What we can add:
> 1. QHash<uint16_t, Format> Definition::formatHash() const;
> 2. Format Definition::format(uint16_t) const;
> 3. QHash<uint16_t, Format> Repository::formatHash() const;
> 4. Format Repository::format(uint16_t) const;

I see an issue with 3) because Definitions are lazy-loaded.
So the number of Format items may grow over time if more Definitions are loaded.
So I think we should not add this.

Greetings
Dominik

> What are our use cases?
> a) print syntax guide (we need all itemDatas)
> b) syntax highlighting (your case)
>
> For a) printing the syntax guide, I think 1+2 would be useful
> For b) syntax highlighting, the full hash is probably easier: 3+4
>
> Adding these functions is not much work, any opinions?
> Shall I create a review request so we can discuss on code level?
>
> @Volker: Any comments from your side? ;)
>
> Greetings
> Dominik
>
>
> On Sat, Jul 28, 2018 at 7:33 PM, Dr.-Ing. Christoph Cullmann
> <cullmann at absint.com> wrote:
>> Hi,
>>
>> after some years, I guess it is really time that we port our highlighting to the infrastructure
>> Volker provides.
>>
>> I started an "syntax-highlighting" branch in our ktexteditor.git to do so.
>>
>> https://cgit.kde.org/ktexteditor.git/log/?h=syntax-highlighting
>>
>> ;=)
>>
>> Thought I already have some questions:
>>
>> 1) The format provides an "id" to store them nicely in our textlines, but how do I get a format back for a given id?
>>    Shall one hash them on the fly with the ids?
>>    Actually it would be more nice to have some vector with all known formats for a highlighting definition.
>>    That would make porting easier, too, as ATM we hold such an "attribute" list per highlighting.
>>    (if that is wrong, Dominik can correct me)
>>
>> 2) Is there a way to get the default style for a format? Would be needed to map them to the KTextEditor default styles
>>    (which are 1:1 as the ones in syntax-highlighting beside a swap of errors/others)
>>
>> Greetings
>> Christoph
>>
>> --
>> ----------------------------- Dr.-Ing. Christoph Cullmann ---------
>> AbsInt Angewandte Informatik GmbH      Email: cullmann at AbsInt.com
>> Science Park 1                         Tel:   +49-681-38360-22
>> 66123 Saarbrücken                      Fax:   +49-681-38360-20
>> GERMANY                                WWW:   http://www.AbsInt.com
>> --------------------------------------------------------------------
>> Geschäftsführung: Dr.-Ing. Christian Ferdinand
>> Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234


More information about the KWrite-Devel mailing list