Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339305

Summary: Preference "Run as you type" should appear only if checker supports that launch mode
Product: [Tools] CDT Reporter: Alex Ruiz <alruiz>
Component: cdt-codanAssignee: Sergey Prigogin <eclipse.sprigogin>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: alruiz, cdtdoug, eclipse.sprigogin
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Fixed a bug in previous patch eclipse.sprigogin: iplog+

Description Alex Ruiz CLA 2011-03-08 19:35:53 EST
Build Identifier: 20110204-0611

Currently the Codan Preference UI for a single problem *always* shows "Run as you type" in the "Launching" tab, regardless if the checker that provided such problem supports that launching mode.

It really does not make too much sense to show this launch mode (and let the user think it means something) if the checker does not support "run as you type".

I'm attaching a patch that does the following:

1. Hides the "run as you type" launch mode from the "Launch" tab for a problem preference UI.
2. As a side-effect, CheckersRegistry now provides the mapping IProblem -> IChecker, something we didn't have before.
3. Created the utility class Checkers, to avoid duplication of code (verification that an IChecker supports "run as you type" launch mode.

Reproducible: Always

Steps to Reproduce:
1. Create a C/C++ project
2. Right-click the top project folder and select "Properties" from the pop-up menu
3. Go to "C/C++ General" -> "Code Analysis"
4. Select "Invalid redefinition" problem from the Problems table
5. Double click that problem, a dialog will appear
6. Go to the "Launching" tab
7. "Run as you type" shows up, even though this checker does not support this launch mode.
Comment 1 Alex Ruiz CLA 2011-03-08 19:37:46 EST
Created attachment 190718 [details]
Proposed patch

Proposed solution.
Comment 2 Alex Ruiz CLA 2011-03-09 17:13:36 EST
Created attachment 190804 [details]
Fixed a bug in previous patch

Fixed bug in previous patch. This patch contains a proposed solution for the bug.
Comment 3 Sergey Prigogin CLA 2011-03-22 22:59:25 EDT
Patch applied to HEAD > 20110322.