August 9, 2010

Vass Vass
Ant Farmer
743 posts

TODO Plugin for QtCreator

Page  
1

In this [developer.qt.nokia.com] 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 [gitorious.org]
Screenshot [dl.yarlug.org]

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

Thanks!

 Signature 


Vasiliy

27 replies

August 9, 2010

Yash Yash
Lab Rat
94 posts

Looks clean and nice. Let me try this.

 Signature 

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

August 9, 2010

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

Could you please add this to the plugin gallery [developer.qt.nokia.com] ?

Thanks!

August 9, 2010

Vass Vass
Ant Farmer
743 posts

Tobias Hunger done!

 Signature 


Vasiliy

August 9, 2010

Markus Liebe Markus Liebe
Lab Rat
40 posts

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:

  • The Items in the build issues are so called tasks [qt.gitorious.org] 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

August 9, 2010

Vass Vass
Ant Farmer
743 posts

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.

 Signature 


Vasiliy

August 9, 2010

Markus Liebe Markus Liebe
Lab Rat
40 posts

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:

  1. QPlainTextEdit *textEdit = 0;
  2. if (editor) {
  3.  textEdit = dynamic_cast<QPlainTextEdit*>(editor->widget());
  4.  if (!textEdit) {
  5.    // do something
  6.  }else{
  7.   // yay! you have a pointer to the textedit that contains the already open file you are looking at.
  8.   // the contents of the file are easy to get:
  9.   QString fileContent(textEdit->toPlainText());
  10.  }
  11. }

Regards,
Markus

August 9, 2010

Vass Vass
Ant Farmer
743 posts

Thank you, Markus! It’s good!

 Signature 


Vasiliy

August 9, 2010

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

… 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.

August 9, 2010

Vass Vass
Ant Farmer
743 posts

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

 Signature 


Vasiliy

August 10, 2010

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

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

September 27, 2010

Vass Vass
Ant Farmer
743 posts

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.

 Signature 


Vasiliy

December 4, 2010

HeartJ HeartJ
Lab Rat
9 posts

Nice work!

December 5, 2010

xsacha xsacha
Lab Rat
517 posts

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.

 Signature 

- Sacha

December 5, 2010

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

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

December 6, 2010

Vass Vass
Ant Farmer
743 posts

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.

 Signature 


Vasiliy

Page  
1

  ‹‹ DIY Planner Dynamic Templates      QBall ››

You must log in to post a reply. Not a member yet? Register here!