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 | * Set content of keyword list with name @p name to @p content | ||||
338 | * Only existing keywordLists() can be changed. For non-existent keyword lists, false is returned. | ||||
339 | * @see keywordList(), keywordLists() | ||||
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 | * | ||||
341 | * This function can be usefull for dynamic higlighting, when the document rehiglights more, that one time. | ||||
342 | * For example, you have a program for editing and running Octave scripts files and | ||||
343 | * you are using KSyntaxHighlighting for syntax higlighting. But also, you can request list of | ||||
344 | * variables, functions, etc from corresponed Octave process. | ||||
345 | * And, used this function, you can provide Octave live higlighting - by passing, for | ||||
346 | * example, variables names from Octave to KSyntaxHighlighting variable keyword list via this function. | ||||
347 | * @since 5.62 | ||||
348 | */ | ||||
349 | bool setKeywordList(const QString& name, const QStringList& content); | ||||
350 | | ||||
351 | /** | ||||
337 | * Returns a list of all Format items used by this definition. | 352 | * 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. | 353 | * The order of the Format items equals the order of the itemDatas in the xml file. | ||
339 | * @since 5.49 | 354 | * @since 5.49 | ||
340 | */ | 355 | */ | ||
341 | QVector<Format> formats() const; | 356 | QVector<Format> formats() const; | ||
342 | 357 | | |||
343 | /** | 358 | /** | ||
344 | * Returns a list of Definitions that are referenced with the IncludeRules rule. | 359 | * 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?