Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Codan launch modes

I think the code is wrong, to disable them you need to use something like that:

getLaunchModePreference(problem).setLaunchModes(CheckerLaunchMode.<what you want to disable>, false);

Il mer 27 mar 2019, 12:42 Aubin Mahé <aubin.mahe@xxxxxxxxxx> ha scritto:
Hi,

It seems I used correctly the API and XML plug-in extensions.

How can I fill a bug?

It's the first time I've to report a bug for Eclipse/CDT/Codan.

Le 17/03/2019 à 21:09, Aubin Mahé a écrit :
> Even when I deactivate "RUN_AS_YOU_TYPE" and "RUN_ON_FILE_OPEN",
> parsing still occurs on file open.
>
> Le 17/03/2019 à 18:47, Nathan Ridge a écrit :
>> Not sure about the first problem, but regarding the second: I'm
>> pretty sure "as you type" is a superset of "on file open", i.e. it
>> doesn't actually wait for you to type. (Internally it's implemented
>> using the platform's "reconciler" mechanism.)
>>
>> Hope that helps,
>> Nate
>>
>> ________________________________________
>> From: cdt-dev-bounces@xxxxxxxxxxx <cdt-dev-bounces@xxxxxxxxxxx> on
>> behalf of Aubin Mahé <aubin.mahe@xxxxxxxxxx>
>> Sent: March 17, 2019 3:40 PM
>> To: cdt-dev@xxxxxxxxxxx
>> Subject: Re: [cdt-dev] Codan launch modes
>>
>> Marc-Andre, your suggestion works well, internal states seems to be good
>> - traces are the same than mine - but the behaviour and the UI panels
>> are wrong, as shown in my first post.
>>
>> First and second problems remains.
>>
>> Le 17/03/2019 à 15:14, Marc-Andre Laperle wrote :
>>> Hi!
>>>
>>> I don’t remember exactly how this works, but here is an example from
>>> ProblemBindingChecker.java:
>>>
>>>        @Override
>>>        public void initPreferences(IProblemWorkingCopy problem) {
>>>                super.initPreferences(problem);
>>>                // This checker should not run on full or incremental
>>> build
>>> getLaunchModePreference(problem).enableInLaunchModes(CheckerLaunchMode.RUN_AS_YOU_TYPE,
>>> CheckerLaunchMode.RUN_ON_DEMAND);
>>>        }
>>>
>>> Maybe you could give this a try?
>>>
>>> Marc-André
>>>
>>>> On Mar 17, 2019, at 10:04 AM, Aubin Mahé <aubin.mahe@xxxxxxxxxx>
>>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I've created a checker plug-in based on CodAn and try to set up
>>>> launch modes.
>>>>
>>>> Checker inherits
>>>> org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker and
>>>> overrides initPreferences because I haven't found any extension
>>>> point dedicated to this usage.
>>>>
>>>>    @Override
>>>>    public void initPreferences( IProblemWorkingCopy problem ) {
>>>>        final LaunchModeProblemPreference lmpp =
>>>>            getLaunchModePreference( problem );
>>>>        lmpp.addLaunchMode( CheckerLaunchMode.RUN_ON_FULL_BUILD,
>>>>            Boolean.FALSE );
>>>>        lmpp.addLaunchMode( CheckerLaunchMode.RUN_ON_INC_BUILD ,
>>>>            Boolean.FALSE );
>>>>        lmpp.addLaunchMode( CheckerLaunchMode.RUN_ON_DEMAND    ,
>>>>            Boolean.TRUE  );
>>>>        lmpp.addLaunchMode( CheckerLaunchMode.RUN_ON_FILE_OPEN ,
>>>>            Boolean.FALSE );
>>>>        lmpp.addLaunchMode( CheckerLaunchMode.RUN_AS_YOU_TYPE  ,
>>>>            Boolean.TRUE  );
>>>>        lmpp.addLaunchMode( CheckerLaunchMode.RUN_ON_FILE_SAVE ,
>>>>            Boolean.FALSE );
>>>>        System.out.println( problem.getName() + ": "
>>>>            + problem.getPreference());
>>>>    }
>>>>
>>>> At runtime, console shows success of initialization:
>>>>
>>>>      ...
>>>>      RAF-LNG-020:
>>>> [org.eclipse.cdt.codan.core.param.FileScopeProblemPreference@4eddffcf,
>>>> [(boolean)RUN_ON_FULL_BUILD=false, (boolean)RUN_ON_INC_BUILD=false,
>>>> (boolean)RUN_ON_DEMAND=true, (boolean)RUN_ON_FILE_OPEN=false,
>>>> (boolean)RUN_AS_YOU_TYPE=true, (boolean)RUN_ON_FILE_SAVE=false],
>>>> (string)suppression_comment]
>>>>      RAF-LNG-030:
>>>> [org.eclipse.cdt.codan.core.param.FileScopeProblemPreference@25264061,
>>>> [(boolean)RUN_ON_FULL_BUILD=false, (boolean)RUN_ON_INC_BUILD=false,
>>>> (boolean)RUN_ON_DEMAND=true, (boolean)RUN_ON_FILE_OPEN=false,
>>>> (boolean)RUN_AS_YOU_TYPE=true, (boolean)RUN_ON_FILE_SAVE=false],
>>>> (string)suppression_comment]
>>>>      ...
>>>>
>>>> First problem:
>>>>
>>>>    Window -> Preferences -> C/C++ -> Code Analysis -> Customize
>>>> Selected (button) -> Launching (tab) shows
>>>>
>>>>      [X] Run as you type
>>>>      [ ] Run on file open
>>>>      [ ] Run as file save
>>>>      [X] Run on incremental build
>>>>      [X] Run on full build
>>>>      [X] Run on demand
>>>>
>>>> Second problem:
>>>>
>>>>      When a file is opened my checker is called and report errors.
>>>>
>>>> How can I really tune launch modes?
>>>> _______________________________________________
>>>> cdt-dev mailing list
>>>> cdt-dev@xxxxxxxxxxx
>>>> To change your delivery options, retrieve your password, or
>>>> unsubscribe from this list, visit
>>>> https://www.eclipse.org/mailman/listinfo/cdt-dev
>>>
>>> _______________________________________________
>>> cdt-dev mailing list
>>> cdt-dev@xxxxxxxxxxx
>>> To change your delivery options, retrieve your password, or
>>> unsubscribe from this list, visit
>>> https://www.eclipse.org/mailman/listinfo/cdt-dev
>>>
>> _______________________________________________
>> cdt-dev mailing list
>> cdt-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or
>> unsubscribe from this list, visit
>> https://www.eclipse.org/mailman/listinfo/cdt-dev
>>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or
> unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/cdt-dev
>
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

Back to the top