Changeset View
Standalone View
src/lib/definition.h
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Line(s) | 107 | public: | |||
---|---|---|---|---|---|
329 | /** | 329 | /** | ||
330 | * Returns the list of keywords for the keyword list @p name. | 330 | * Returns the list of keywords for the keyword list @p name. | ||
331 | * @since 5.49 | 331 | * @since 5.49 | ||
332 | * @see keywordLists() | 332 | * @see keywordLists() | ||
333 | */ | 333 | */ | ||
334 | QStringList keywordList(const QString& name) const; | 334 | QStringList keywordList(const QString& name) const; | ||
335 | 335 | | |||
336 | /** | 336 | /** | ||
337 | * Insert keyword @p keyword into the keyword list @p keywordListName | ||||
338 | * @since 5.62 | ||||
339 | */ | ||||
dhaumann: Please improve the API documentation and add, for instance:
- Only existing keywordLists() can… | |||||
I more thinking in variant, when the highlighting more dynamic, and is done more, that one time. For example, in Cantor, we rehighlight whole worksheet, when a new variable created in curresponding session. So, if you write "my_var = 3" in Python session (and run command cell with this command), "my_var" starts to highlight by Cantor as variable after that. sirgienko: I more thinking in variant, when the highlighting more dynamic, and is done more, that one time. | |||||
Fair enough :-) What you just described here is missing in the API documentation. Can you add this to setKeywordList()? Then it's clear to the user of KSyntaxHighlighting (e.g. that you have to force a rehighlight of your document, best even explain how). dhaumann: Fair enough :-) What you just described here is missing in the API documentation. Can you add… | |||||
Is it enough? I mean, I can add explanation, that rehiglighting whole document (after keyword list modification) works via QSyntaxHighlighter::rehighlight(), but i think, it is pretty obivously for a KSyntaxHiglighting user. sirgienko: Is it enough? I mean, I can add explanation, that rehiglighting whole document (after keyword… | |||||
I think it's better. I'll take a look later and try to improve this and add you as reviewer :) dhaumann: I think it's better. I'll take a look later and try to improve this and add you as reviewer :) | |||||
340 | bool insertKeyword(const QString& keywordListName, const QString& keyword); | ||||
341 | | ||||
342 | /** | ||||
343 | * Erase keyword @p keyword from the keyword list @p keywordListName | ||||
344 | * @since 5.62 | ||||
345 | */ | ||||
346 | bool eraseKeyword(const QString& keywordListName, const QString& keyword); | ||||
347 | | ||||
348 | /** | ||||
337 | * Returns a list of all Format items used by this definition. | 349 | * Returns a list of all Format items used by this definition. | ||
338 | * The order of the Format items equals the order of the itemDatas in the xml file. | 350 | * The order of the Format items equals the order of the itemDatas in the xml file. | ||
339 | * @since 5.49 | 351 | * @since 5.49 | ||
340 | */ | 352 | */ | ||
341 | QVector<Format> formats() const; | 353 | QVector<Format> formats() const; | ||
342 | 354 | | |||
343 | /** | 355 | /** | ||
344 | * Returns a list of Definitions that are referenced with the IncludeRules rule. | 356 | * Returns a list of Definitions that are referenced with the IncludeRules rule. | ||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |
Please improve the API documentation and add, for instance:
What I am currently also missing is a section about highlight invalidation: Does one have to trigger a document rehighlight oneself, and if so, how?
My point is: Assume a doc is highlighted up to line 100. Now you add keywords to a list that are used in these 100 lines, i.e. the highlighting may change arbitrarily.
How is the KSyntaxHighlighting user supposed to trigger a rehighlight? Or should one only change keyword lists before highlighting any document?