Re: [Qt-creator] Plugin to display compile errors warnings etc. inline
On Jul 9, 2010, at 9:04 AM, ext Liebe Markus (RtP2/TEF72) wrote: 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... We've got a similar problem to solve when talking about auto test integration and test results. What is definitely not a solution is to add dozens of additional output tabs for the different things :) I could imagine that a good way would be to rename the build issues tab to something like only Issues and use it for the different kind of things that need attention: TODOs/FIXMEs, failing test results, build issues, etc. The classes for that output pane have already been called TaskHub and TaskWindow, not BuildIssueHub etc, maybe that's a hint ;) Br, Eike 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 todoDisplay.pngATT1..txt -- Eike Ziller Software Engineer Nokia, Qt Development Frameworks Nokia gate5 GmbH Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B Umsatzsteueridentifikationsnummer: DE 812 845 193 Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Plugin to display compile errors warnings etc. inline
We've got a similar problem to solve when talking about auto test integration and test results. What is definitely not a solution is to add dozens of additional output tabs for the different things :) Yes, I agree with that. I could imagine that a good way would be to rename the build issues tab to something like only Issues and use it for the different kind of things that need attention: TODOs/FIXMEs, failing test results, build issues, etc. That's what I was thinking, too. As a consequence I think it should be possible to provide Icons for those types of tasks that are no real build issues. Those other issues might not always be of the type warning,error or unknown after all. The classes for that output pane have already been called TaskHub and TaskWindow, not BuildIssueHub etc, maybe that's a hint ;) Well the wording task was exactly what made me think that this is the correct place to display things like TODO and FIXME markers, because what they really are is tasks =) Best regards, Markus ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Plugin to display compile errors warnings etc. inline
I introduced a *TaskHub* which essentially emits all the task related signals the buildmanager had, and also the new signals you need. Hi Daniel, I am using your new TaskHub now to create tasks for //todo comments as well. The TaskHub has the interface to add new categories of tasks, but it seems to me that there is no way to add new Icons for the categories as well. Is it possible for you to extend that a bit? It would be great to have a possibility to use own icons for new task categories. Best regards, Markus ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Plugin to display compile errors warnings etc. inline
Hi Markus! On 08.07.2010 15:07, ext Liebe Markus (RtP2/TEF72) wrote: I am using your new TaskHub now to create tasks for //todo comments as well. The TaskHub has the interface to add new categories of tasks, but it seems to me that there is no way to add new Icons for the categories as well. Categories are the strings seen in the build issues view when clicking on that little funnel icon (rightmost one). Is it possible for you to extend that a bit? So far there is only a string used. What do you want in addition to that? It would be great to have a possibility to use own icons for new task categories. 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. PS: Just curious: How are you parsing for the FIXMEs/TODOs? Are you hooking into the C++ parser framework? -- Tobias Hunger Software Engineer Nokia, Qt Development Frameworks Nokia gate5 GmbH Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B Umsatzsteueridentifikationsnummer: DE 812 845 193 Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Plugin to display compile errors warnings etc. inline
Hello Daniel, At the moment I connect the BuildManager::tasksChanged() signal to a slot where I query the BuildManager to get all the tasks. It would be nice if there was a signal like BuildManager::taskAdded(const ProjectManager::Task). Yes, such a signal sounds reasonable. Think so, too =) If there is no such Interface at the moment, would it be possible for you to extend the BuildManager and add such an interface? Well, I suppose you could create a merge request with the changes you need. As I am sitting behind a corporate firewall it is not possible for me at the moment to do a git push to gitorious. And as a consequence I cannot create a merge request via gitorious. So I decided to send the little patch containing the changes to the list. The patch is against QtCreator 2.0.0 It just adds the following new signals BuildManager::taskAdded(const ProjectManager::Task) BuildManager::tasksCleared() TaskWindow::tasksCleared() Can you check if it is possible to add these small changes to qtcreator? Mit freundlichen Grüßen / Best regards Markus Liebe Robert Bosch GmbH Automotive Electronics, RtP2/TEF72 Postfach 13 42 72703 Reutlingen GERMANY www.bosch.com Tel. 07121 35-35246 markus.li...@de.bosch.com Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000; Aufsichtsratsvorsitzender: Hermann Scholl; Geschäftsführung: Franz Fehrenbach, Siegfried Dais; Bernd Bohr, Rudolf Colm, Volkmar Denner, Gerhard Kümmel, Wolfgang Malchow, Peter Marks, Peter Tyroller; Uwe Raschke changesForInlineTaskDisplay.patch Description: changesForInlineTaskDisplay.patch ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Plugin to display compile errors warnings etc. inline
at the moment I am creating a plugin for QtCreator to display compile warnings and errors (tasks) inline. See attached screenshot. Looks quite nice. I am trying to do this by only adding new code to QtCreator in form of a QtCreator plugin. There are however several things that I could not accomplish without little changes to QtCreators code itself: Well, if there's a missing interface, method, do speak up. Don't try to hack around it, we quite often can add more stuff. To get a list of all tasks I had to extend the BuildManager so that I am able to query the BuildManager to get a List of ProjectExplorer::Tasks. Is there a way to get this list of tasks in a plugin via a public Interface? It seems that's currently not possible. At the moment I connect the BuildManager::tasksChanged() signal to a slot where I query the BuildManager to get all the tasks. It would be nice if there was a signal like BuildManager::taskAdded(const ProjectManager::Task). Yes, such a signal sounds reasonable. If there is no such Interface at the moment, would it be possible for you to extend the BuildManager and add such an interface? Well, I suppose you could create a merge request with the changes you need. E.g. currently there are two cases when the build issues list is cleared. a) When you start a new build b) Pressing the clear all button in the build issues list I don't know whether b) should also clear the editor of all inline markers. (I suppose it should.) You probably need signals for that too then. daniel ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Plugin to display compile errors warnings etc. inline
E.g. currently there are two cases when the build issues list is cleared. a) When you start a new build b) Pressing the clear all button in the build issues list I don't know whether b) should also clear the editor of all inline markers. (I suppose it should.) You probably need signals for that too then. I would argue that b) does indeed need it. /s/ Adam ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator