Fix problems tooltip
ClosedPublic

Authored by antonanikin on Nov 7 2016, 11:24 AM.

Details

Summary

This patch fixes problems tooltips. Current version shows tooltips only for problems from built-in parser. New version provides:

  1. Tooltips for all problems (IProblem interface) stored in any Problem Model.
  1. "Multi-error" tooltips. One line can contains several problems, new version shows them all in one tooltip.
  1. "Multi-error" tooltips are sorted by problem severity.
Test Plan

Tested on master branch with kdev-cppcheck, kdev-valgrind, kdev-verapp plugins. All tested cases work correcttly:

  1. "Single-error" tooltips (old behavior). Works with built-in parser and external plugins.
  2. "Multi-error" tooltips without assistants.
  3. "Multi-error" tooltips with assistants.

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
antonanikin updated this revision to Diff 7967.Nov 7 2016, 11:24 AM
antonanikin retitled this revision from to Fix problems tooltip.
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
antonanikin added reviewers: KDevelop, kfunk.
antonanikin added a subscriber: kdevelop-devel.
antonanikin edited the test plan for this revision. (Show Details)Nov 7 2016, 11:34 AM
kfunk edited edge metadata.Nov 16 2016, 11:08 PM

Rest LGTM, nice idea! Please update the patch, then I'll have another look.

language/duchain/navigation/problemnavigationcontext.cpp
85

When sorting by multiple sort criterias I favor this pattern here: http://stackoverflow.com/a/3574724

Or, let's be fancy and use C++11 std::tie: http://stackoverflow.com/a/17080762

118

Shouldn't this method be called escapedHtml or something?

263–265

.at(...)

And you should assert that action != nullptr in that case then. No need for the else-branch.

antonanikin marked 3 inline comments as done.Nov 17 2016, 3:46 AM
antonanikin added inline comments.
language/duchain/navigation/problemnavigationcontext.cpp
85

Fixed. Thanks for std::tie link, but it's impossible to use it for this case - it requires lvalues, but we have only rvalues :(

antonanikin updated this revision to Diff 8244.Nov 17 2016, 3:47 AM
antonanikin marked an inline comment as done.
antonanikin edited edge metadata.

remarks fixes

kfunk accepted this revision.Nov 17 2016, 8:25 AM
kfunk edited edge metadata.

Looks good to me, let's try that in master. We can fix more issues later.

language/duchain/navigation/problemnavigationcontext.cpp
85

Ah, sure.

115

Add that documentation snippet to the header file instead.

This revision is now accepted and ready to land.Nov 17 2016, 8:25 AM
antonanikin updated this revision to Diff 8250.Nov 17 2016, 8:32 AM
antonanikin edited edge metadata.

comment fix

This revision was automatically updated to reflect the committed changes.