| Summary: | Quick Fix for "case break" checker | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Gil Barash <scobido1984> | ||||
| Component: | cdt-codan | Assignee: | Elena Laskavaia <elaskavaia.cdt> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> | ||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | cdtdoug, malaperle, scobido1984 | ||||
| Version: | 8.0 | ||||||
| Target Milestone: | 8.1.0 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Gil Barash
I reviewed the patch: - Lets not use special expression for comment, I am working on common framework for comments and I don't want confuse people with diffrent way of entering comment, current one would be just case insensive string containing in comment, so no | - Ast locations should not be stored in extra problem arguments, you should extract same location in quick fix itself from the node of the problem itself (problems are persistent markers, they also can move with line number changes) - There is no point storing comment in the problem marker either - it can be extracted from problem type parameter - Inserting function instead of comment is very ugly, I would ignore the indentation issues - just inset the comment and remove the other ugliness - Need protection from exceptions everywhere, for example old codan problems would not have paramters, so it should not throw exceptions, just work based on some default values fixed in Next cdt, I pretty much rewrote all the code of the patch, but thanks for the inspiration - I made checker report error on last statement before the break instead of case, which is better anyway - I remove parameters for error, because quick fix can figure it out itself - I make comment quick fix use document API directly to insert the comment, instead of dealing with ast rewrite since it is an overkill - I made break fix figure out position by itself *** cdt git genie on behalf of Alena Laskavaia ***
Bug 352221 - Quick Fix for "case break" checker
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=6f2671b1eeccb5ede9328c1aa89db3e2bf232f8f
*** cdt git genie on behalf of Alena Laskavaia ***
Bug 352221 - Quick Fix for "case break" checker
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d70aae3b111e208bb0540c688b4d6d6b7732ad6a
Wow, thanks Alena, I was really going to fix it according to what you suggested, on the weekend... You've beat me to the punch :-) |