how to get the list of keywords in KSyntaxHighlighting

Dominik Haumann dhaumann at kde.org
Sun Jul 29 11:57:50 BST 2018


Hi Alexander,

sorry for the delay, I only now saw your mail.
Jonathan meanwhile posted a patch that adds this:
https://phabricator.kde.org/D14434

I definitely can see that adding these functions:
    QStringList keywordListsNames() const;
    QStringList keywordList(const QString& name) const;
is of interest, and I don't see how it could hurt in any way.

However, pushing this further, what Kate also needs is a way go get
all keyword lists that are matched in the current context. This allows
for instance for context based auto completion that Kate also supports.

Would that be of interest for you as well

Greetings
Dominik

On Sun, Jul 15, 2018 at 11:54 AM, Alexander Semke
<alexander.semke at web.de> wrote:
> Hi,
>
> I'd like to remove the maintenance of syntax keywords in Cantor (e.g. https://
> cgit.kde.org/cantor.git/tree/src/backends/maxima/maximakeywords.cpp) and to
> switch to KSyntaxHighlighting.
>
> Cantor uses its own highlighters and I'd need to get the list of keywords from
> KSyntaxHighlighter for this (constructor in https://cgit.kde.org/cantor.git/
> tree/src/backends/maxima/maximahighlighter.cpp). If I see it correctly,
> DefinitionData holding the keyword lists is not part of the public API. I don't
> see how to get the list of keywords.
>
> Ideally, there should be something like
>
> QStringList Definition::keywordListsNames() const;
>
> to get the list of available section in the xml syntax file and
>
> QStringList Definition::keyworkList(const QString& name) const;
>
> to get the actual keywords for the specified section.
>
>
> Would this make sense or is there already another way to get the keywords?
>
>
> Regards,
> Alexander
>
>


More information about the Kde-frameworks-devel mailing list