0

Kate editor (and QtCreator too) uses the same xml configs for the highlighting a syntax of the files. e.g. doxygen

however ,it looks oddly for me because of:

  1. The file under the link above - doxygen.xml, does this refer to doxygen sources (I mean c++ source files where doxygen notation is used) or to doxygen configuration? I believe second because of line in the file:

extensions=".dox;.doxygen"

however .dox files have a different syntax, similar to plain config files

  1. If previous question's reply is to doxygen source files, how does it work ?

======================================================================= an update:

the processing a piece like this:

EXTENSION_MAPPING      = hpp=c++ \ #lkfjglkfdjglfdkjgl
                         cpp=c++ \ #lkdjfglkdfjlgdfkjgld
                         h=c++     #gfjkdlgkjfdlgkjdlfk

this context processes this case:

 <context name="Value" attribute="UntypedValue" lineEndContext="#pop" >
  <Float attribute="Float" />
  <Int attribute="Int" />
  <keyword attribute="Value" String="values" />
  <RegExpr attribute="Comment" context="#pop" String="#.*$" />
  <LineContinue />
 </context>

however you see this only can process lineContinue if the line doesn't contain a comment. Looking for a fix

amigo421
  • 2,429
  • 4
  • 26
  • 55
  • so, how this relates to `kate`? – zaufi Jun 17 '16 at 19:38
  • my understanding that qtctrator editor based on kate and uses the same settings structure. so I've added kate to a question to make chances higher if kate users could share their experience. but please ignore my question , because it was resolved – amigo421 Jun 20 '16 at 07:21
  • then you can post an answer to yourself, so others could find a solution for similar problem :) or at least wouldn't try to respond :) – zaufi Jun 20 '16 at 12:47
  • `kate` and seems Qt Creator uses `ktexteditor` component of KDE, which is actually has a highlighting engine (not `kate`). So it is a matter of particular UI how to "reset" highlighting. The other way is to use _kate modeline_ (like `// kate: hl c++;`) to force highlighting... – zaufi Jun 20 '16 at 12:49
  • re-wrote the question , please review – amigo421 Jun 23 '16 at 12:10
  • 1
    answering your questions, 1) no, this file is not intended to be used by itself, it is designed to be a part of other syntax files (except rare cases, when someone decide to write docs in `.dox` files "directly". btw I dunno that is it). 2) this syntax actually included into others (like C++, Java, JS, ...) and "works" when parent syntax parse comments... so actually there is mostly no reason to choose this highlighting for any of your files... – zaufi Jun 23 '16 at 19:00
  • thank you. got it. actually my goal is a defining configuration for doxygen config files highlighting – amigo421 Jun 24 '16 at 05:51
  • nowadays there is no such syntax file... you can do it and share w/ the kate team :) (fortunately this particular syntax is pretty easy to write) – zaufi Jun 24 '16 at 12:57
  • just added such files to INI highlighter. syntax is exacly the same – amigo421 Jun 24 '16 at 14:45
  • actually it could be a little smarter than generic INI hightlighter. For example, you can get a list of really existed variables (and make a list of keywords from it) and highlight everything else as errors (not existed keys). As I can see `ini.xml` has some redundant things (like PHP errors) and lack of line continuation handling (e.g. in doxygen config one may use `\\` character in values). – zaufi Jun 25 '16 at 15:02
  • Also, some build systems like autoconf or CMake, could use a `Doxyfile.in` (template) to generate a real `Doxyfile` after "configuration" stage. In that template it would be nice to highlight variable substitutions… – zaufi Jun 25 '16 at 15:12
  • you are right, this is also my way, I'm using doxy template with a couple cmake variables. so I'll try to write this config – amigo421 Jun 25 '16 at 16:04
  • great! I'm also use `doxygen` from CMake extensively, so it'll be nice if you share your work :) (and yes, `kate` is the only editor for my daily work) – zaufi Jun 26 '16 at 16:58
  • not so easy for me, look at this during the week but stil don't understand the workflow on the processing... – amigo421 Jun 30 '16 at 15:03
  • have you seen [the docs](https://kate-editor.org/2005/03/24/writing-a-syntax-highlighting-file/)? The key thing w/ highlighting rules is that if any rule match (and not switch to another context), then it'll restart matching from the beginning of the current context (consuming matched text). It is why rules order is important... – zaufi Jul 01 '16 at 07:37
  • sorry for my incorrect message, I mean that I wrote simple config based on ini but with a checking doxy settings keywords as discussed but there are some issues which I still can't resolve. see initial updated post. and would be perfect if you could look and try this config. how can I contact with you outside of stackoverflow or send a private message here? thank you! – amigo421 Jul 01 '16 at 12:26
  • you may find me on github, there is contact details in my profile (same nick( – zaufi Jul 04 '16 at 16:32

1 Answers1

1

I'm the original author of doxygen.xml.

Kate's Doxygen highlighting (and therewith also Qt Creator's) requires you to first step into the Doxygen context: That is, you need to start a Doxygen comment first by either /**, ///, or //!.

Then, you get proper highlighting for all Doxygen commands.

So this is not for Doxygen configuration itself, if I understand you correctly.

dhaumann
  • 1,590
  • 13
  • 25
  • thank you for the reply. yes, you understand this right. I thou that is about config. but now it's clear. for the config, I wrote basic doxy config XML highlighter, but for prod, it requires a lot of improvements, still haven't time to finalise... – amigo421 Aug 01 '16 at 13:17
  • Ok, if this answers your question, can you accept this answer? :) – dhaumann Aug 01 '16 at 14:52