Fix highlighting for problems with incomplete finalLocation
ClosedPublic

Authored by antonanikin on Oct 29 2016, 7:57 AM.

Details

Summary

This patch fixes highlighting for problems, which has incomplete finalLocation. Many checkers produce only line number in the log, which makes impossible to set correct range for problem without parsing of checked source file. To fix this case we adds LocationRangeMode methods which allows to control highlighting process for such problems.

Test Plan

Tested on master branch with kdev-cppcheck plugin.

Results (line 63):

Original (old) behavior, ugly 1-symbol highlighting

New (improved behavior, with TrimmedLine mode

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 7743.Oct 29 2016, 7:57 AM
antonanikin retitled this revision from to problem_location_mode.
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptOct 29 2016, 7:57 AM
antonanikin retitled this revision from problem_location_mode to Fix highlighting for problems with incomplete finalLocation.Oct 29 2016, 8:05 AM
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
antonanikin added a reviewer: KDevelop.
antonanikin updated this revision to Diff 7744.Oct 29 2016, 8:10 AM

small fixes

antonanikin updated this revision to Diff 7812.Nov 2 2016, 7:53 AM
  • Codestyle fixes
This revision was automatically updated to reflect the committed changes.
kfunk reopened this revision.Nov 2 2016, 8:23 AM
kfunk added a subscriber: kfunk.
kfunk added inline comments.
interfaces/iproblem.h
99

Please turn IProblem into a real interface again. You need to implement the methods in the subclasses.

antonanikin updated this revision to Diff 7814.Nov 2 2016, 9:02 AM
  • Move new methods implementation into subclasses to turn IProblem into a real interface again.
antonanikin marked an inline comment as done.Nov 2 2016, 9:03 AM
kfunk requested changes to this revision.Nov 2 2016, 9:20 AM
kfunk added a reviewer: kfunk.
kfunk added inline comments.
language/duchain/problem.cpp
107

Better implement that properly as well. Just follow the way it's done for the other getters/setters.

111

Dito

This revision now requires changes to proceed.Nov 2 2016, 9:20 AM
antonanikin updated this revision to Diff 7815.Nov 2 2016, 9:32 AM
antonanikin edited edge metadata.
  • Fix KDevelop::Problem
antonanikin marked 2 inline comments as done.Nov 2 2016, 9:35 AM
kfunk requested changes to this revision.Nov 2 2016, 9:51 AM
kfunk edited edge metadata.
kfunk added inline comments.
language/duchain/problem.cpp
112

Here: Look at Problem::finalLocation and Problem::setFinalLocation for inspiration.

language/duchain/problem.h
244

This needs to be in ProblemData instead. Sorry for not telling you in my earlier review ;)

This revision now requires changes to proceed.Nov 2 2016, 9:51 AM
antonanikin updated this revision to Diff 7816.Nov 2 2016, 10:13 AM
antonanikin edited edge metadata.
  • Fix KDevelop::Problem
antonanikin marked an inline comment as done.Nov 2 2016, 10:24 AM
kfunk accepted this revision.Nov 2 2016, 12:18 PM
kfunk edited edge metadata.
This revision is now accepted and ready to land.Nov 2 2016, 12:18 PM
This revision was automatically updated to reflect the committed changes.