Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Showcase
  4. TODO Plugin for QtCreator
QtWS25 Last Chance

TODO Plugin for QtCreator

Scheduled Pinned Locked Moved Showcase
28 Posts 10 Posters 25.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vsorokin
    wrote on 8 Aug 2010, 23:26 last edited by
    #1

    In "this ":http://developer.qt.nokia.com/forums/viewthread/69/ thread Esdras Beleza asked about plugin, which show list of TODO, FIXME, etc comments. And Markus Liebe created it, but didn't published :(

    On weekend, I created plugin, which show TODO (and etc) comments list in current open file.

    "Download source":http://gitorious.org/qt-creator-todo-plugin
    "Screenshot":http://dl.yarlug.org/misc/todoplugin/todoplugin.png

    P. S. It's first version and it's very simple, I accept suggestions for improvement.

    Thanks!

    --
    Vasiliy

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yash
      wrote on 9 Aug 2010, 07:17 last edited by
      #2

      Looks clean and nice. Let me try this.

      http://kineticwing.com : Web IDE, QSS Editor
      http://speedovation.com : Development Lab

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on 9 Aug 2010, 08:26 last edited by
        #3

        Could you please add this to the "plugin gallery ":http://developer.qt.nokia.com/wiki/Qt_Creator_Plug-in_Gallery ?

        Thanks!

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vsorokin
          wrote on 9 Aug 2010, 10:11 last edited by
          #4

          Tobias Hunger done!

          --
          Vasiliy

          1 Reply Last reply
          0
          • M Offline
            M Offline
            markus.liebe
            wrote on 9 Aug 2010, 11:50 last edited by
            #5

            Hi Vass!

            nice work. I did something similar a little time ago as you mentioned. The problem is that I cannot make the code public available at the moment, because of company policies :(

            However I just skimmed through your code and I have the following suggestions:

            • do not create a new Outputpane but use the one that is used for build issues. (see QtCreator's ProjectExplorer::"TaskHub":http://qt.gitorious.org/qt-creator/qt-creator/blobs/master/src/plugins/projectexplorer/taskhub.h ) You can then benefit from the already existing navigation feature to navigate the todo items and jump to the todo item in the code.

            • The Items in the build issues are so called "tasks":http://qt.gitorious.org/qt-creator/qt-creator/blobs/master/src/plugins/projectexplorer/task.h You can use this class instead of creating a new class that does the same.

            • make the plugin configurable, so that you can configure the pattern for the todo item comments (todo, bug, fixme, hack etc.)

            ok so long for the moment. If you need more information or some help, just ask.

            Regards,
            Markus

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vsorokin
              wrote on 9 Aug 2010, 13:26 last edited by
              #6

              Hi Markus!

              1. I think new pane is good idea for me, because I planning show all entries in project in the future.
              2. Navigation will be added - it's simple.
              3. Plugin settings also in planning.

              Thank you for your offer to help.
              I have a question.
              Now file parsing is very slow and simple, I think must use Find plugin for parsing, but I don't know how I can it.
              Any ideas?

              P. S. Sorry, my english on basic level.

              --
              Vasiliy

              1 Reply Last reply
              0
              • M Offline
                M Offline
                markus.liebe
                wrote on 9 Aug 2010, 13:44 last edited by
                #7

                Hi Vass,

                concerning the file parsing:

                • you do not need to open the file for your plugin again. In your slot "currentEditorChanged()" you can do the following:

                @
                QPlainTextEdit textEdit = 0;
                if (editor) {
                textEdit = dynamic_cast<QPlainTextEdit
                >(editor->widget());
                if (!textEdit) {
                // do something
                }else{
                // yay! you have a pointer to the textedit that contains the already open file you are looking at.
                // the contents of the file are easy to get:
                QString fileContent(textEdit->toPlainText());
                }
                }
                @

                Regards,
                Markus

                1 Reply Last reply
                0
                • V Offline
                  V Offline
                  vsorokin
                  wrote on 9 Aug 2010, 13:47 last edited by
                  #8

                  Thank you, Markus! It's good!

                  --
                  Vasiliy

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    tobias.hunger
                    wrote on 9 Aug 2010, 15:58 last edited by
                    #9

                    ... but then you do not get the project wide TODOs, only those in the currently open files. I am not sure whether that is what you want or not.

                    I would like to second Markus suggestion to use Tasks and the Build issues view. That way you get instant access to the TaskHandler infrastructure used to implement the functionality seen in the build issues context menu/navigation. I would consider "Blame" TaskHandler to be very useful in the context of TODO/HACK items:-)

                    It would be pretty trival to add a "Mark as done" TaskHandler, too which would trigger a quickfix to remove the TODO comment...

                    The downside of using tasks is that -- at this time -- they do expect a error/warning/other kind of severity and that the icons are hardcoded based on this severity.

                    1 Reply Last reply
                    0
                    • V Offline
                      V Offline
                      vsorokin
                      wrote on 9 Aug 2010, 21:52 last edited by
                      #10

                      Thank you, Tobias, for your opinion, I shall think about it.

                      --
                      Vasiliy

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        tobias.hunger
                        wrote on 10 Aug 2010, 07:55 last edited by
                        #11

                        Vass: Feel free to contact me if you need enhancements to the task class;-) I am happy to discuss your requirements.

                        1 Reply Last reply
                        0
                        • V Offline
                          V Offline
                          vsorokin
                          wrote on 27 Sept 2010, 20:47 last edited by
                          #12

                          Hi Folks! I update my plugin.

                          Recent changes:

                          • Plugin settings available
                          • Task window or Todo pane output selector
                          • Scanning all file in project or only current file selector
                          • Keywords editor
                          • Locale support
                          • Bug fixes and new bugs :)

                          Please, use and test it, and report me you suggestions.

                          --
                          Vasiliy

                          1 Reply Last reply
                          0
                          • H Offline
                            H Offline
                            HeartJ
                            wrote on 4 Dec 2010, 16:03 last edited by
                            #13

                            Nice work!

                            1 Reply Last reply
                            0
                            • X Offline
                              X Offline
                              xsacha
                              wrote on 5 Dec 2010, 02:12 last edited by
                              #14

                              Every IDE needs this. It is brilliant and just what I was looking for. Is there any reason why this doesn't come with QtCreator?

                              Prefer the new pane rather than inside build frame like Markus plugin. Glad you guys are working together on it.

                              • Sacha
                              1 Reply Last reply
                              0
                              • T Offline
                                T Offline
                                tobias.hunger
                                wrote on 5 Dec 2010, 09:20 last edited by
                                #15

                                Vass: How about doing a merge request to get your work into Qt Creator proper?

                                1 Reply Last reply
                                0
                                • V Offline
                                  V Offline
                                  vsorokin
                                  wrote on 6 Dec 2010, 21:14 last edited by
                                  #16

                                  Hello Tobias!
                                  Sorry, noticed your comment only now (because of all this "Project Elf" rush)

                                  I will very glad, if my plugin will merge to QtCreator, but I don't know what needed for it.
                                  And now plugin not compatible with MASTER of QtCreator.

                                  I think there are some rules for merge request will be accepted.
                                  If you help me and tell me what I should do for merge, I'll be very grateful.

                                  --
                                  Vasiliy

                                  1 Reply Last reply
                                  0
                                  • ? This user is from outside of this forum
                                    ? This user is from outside of this forum
                                    Guest
                                    wrote on 7 Dec 2010, 05:54 last edited by
                                    #17

                                    Tobias, building on the Vass plugin, could something be built to do static code analysis within the creator going fwd? something like the checkstyle or PMD plugin available for eclipse? could be very helpful to the developers

                                    1 Reply Last reply
                                    0
                                    • V Offline
                                      V Offline
                                      vsorokin
                                      wrote on 7 Dec 2010, 06:59 last edited by
                                      #18

                                      Chetan, Unlikely it's not possible, this plugin is very-very simple.

                                      --
                                      Vasiliy

                                      1 Reply Last reply
                                      0
                                      • T Offline
                                        T Offline
                                        tobias.hunger
                                        wrote on 7 Dec 2010, 08:11 last edited by
                                        #19

                                        chetankjain: We are starting to introduce checks static code analysis. Currently most of the prototyping seems to happen in the QML camp: They introduced JSlint like functionality into the QML editor recently.

                                        The C++ engine is prepared ready to add more checks, too, but so far nobody found the time to get down and write some checks.

                                        Of course there is also the quick fixes (in C++ as well as QML) which can even "fix up" common problems for you. There are already some of those, but the UI is not really giving any feedback where you can fix things at this time... Try e.g. hitting Alt-Return on a string constant.

                                        1 Reply Last reply
                                        0
                                        • ? This user is from outside of this forum
                                          ? This user is from outside of this forum
                                          Guest
                                          wrote on 7 Dec 2010, 08:53 last edited by
                                          #20

                                          yes Tobias have seen some of the c++ refactor options in creator, will chk on the QML part

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved