[Qt-creator] Plugin to display compile errors warnings etc. inline
Liebe Markus (RtP2/TEF72)
Markus.Liebe at de.bosch.com
Fri Jul 9 09:04:49 CEST 2010
Hi,
> > Is it possible for you to extend that a bit?
I was hoping to be able to somehow add an Icon to the FIXME, TODOS.
> So far there is only a string used. What do you want in
> addition to that?
I am fine with that.
>
> Icons are only used for the task types (Warning, Error and Unknown).
> These types can not get extended at this time (and actually I do not
> consider that a good idea to extend them;-), so we have not seen any
> need to add icons at this time.
I see. So there are multiple Categories like "QML,Compile,Build System".
Those categories all belong to the "Build Issues".
At the moment I created another category "todo" for the FIXME/TODOS/HACK etc.
All comments are added into the "Build Issues" pane as well, just like the compiler
warnings and errors and it would make it easier for the eye to have a "todo"-Icon
for each entry.
I am not quite sure right now if the "Build Issues" really is the correct place for it.
In terms of functionality it is: I can navigate the todos like the warnings/errors
which makes it consistent (and easy to implement ;) )
But on the other hand TODOS and FIXME entries are not really "BuildIssues"...
> PS: Just curious: How are you parsing for the FIXMEs/TODOs? Are you
> hooking into the C++ parser framework?
No, I am using a quite simple minded approach. As I want to have all additional code
in the plugin I do not want to modify QtCreators code if it is not necessary.
I have three triggers that I use to start the parsing:
1.) Whenever a new editor is opened I read its contents and parse each line for comments
starting with a given keyword like "TODO","FIXME","HACK" etc. to build up an internal
list of the items and I add them to the taskwindow via the taskhub.
2.) Whenever the current file is changed (saved etc.) I do the same.
3.) Whenever the current text is changed I look on the current line where the TextCursor is
and just parse that line. If it contains one of the searched comments I check if there
already is a "Task" for that line. If so, then I just modify that task. If not I add a
new one.
If the line does not contain a comment but I already have a task for it, I remove that
Task.
At the moment I looks like the attached screenshot.
Regards,
Markus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: todoDisplay.png
Type: image/png
Size: 89471 bytes
Desc: todoDisplay.png
Url : http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20100709/46893085/attachment.png
More information about the Qt-creator-old
mailing list