Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to restart the language provider scanner?

Hi Jantje,

On Thu, Mar 7, 2013 at 3:02 PM, Jan Baeyens <jan@xxxxxxxxxx> wrote:
> Andrew
> Thanks for the answer. It got me closer to understanding but not yet to the
> answer to my question
>
>
> What is the API code to force the language provider to rerun?
>
> As you suggested I put a breakpoint in
>
> AbstractBuiltinSpecsDetector.execute()
>
> I learned from that when you do
>
>
> [Clear Entries] and use [Apply] or [OK] button.
>
> There is no scan because the value of isExecuted is true.
[Clear Entries] calls clear() method of the provider which sets
isExecuted to false. Did you override clear() by any chance?

>
>     protected void execute() {
>
>         if (isExecuted) {
>
>             return;
>
>         }
>
> On the other hand when I do as I suggested isExecuted is false and a
> recalculation is done.
>
> As to
>
>
> It is a bit more complicated than that. If you change project settings
> in UI and rerun provider before saving the settings you are getting in
> inconsistent state. Suppose the user cancels project settings changes.
> You get old settings and provider results corresponding to
> non-existent project state.
>
> I action this when the user presses ok and I do not start a monitor so there
> is no cancel.
> I save all settings.
> I delete the build folder (Because the outcome of previous build is
> completely invalid )
> I tell the language provider to rerun.
>
> But I still don't know how to force the language provider to rerun.
It is done internally based on isExecuted flag after OK button is
pressed. Keep in mind that it happens in background thread. Do you use
UI from CDT or developing your own?

Thanks,
Andrew

> Best regards
> Jantje
>
>
>
> On 06-Mar-13 14:46, Andrew Gvozdev wrote:
>>
>> Hi Jan,
>> It is a bit more complicated than that. If you change project settings
>> in UI and rerun provider before saving the settings you are getting in
>> inconsistent state. Suppose the user cancels project settings changes.
>> You get old settings and provider results corresponding to
>> non-existent project state.
>>
>> So, in current UI to rerun provider you would [Clear Entries] and use
>> [Apply] or [OK] button. [Clear Entries] will create a temporary copy
>> of the provider which has not been executed yet. [OK] button will save
>> the project settings and trigger reruns of not-executed providers. You
>> can inspect stack trace if you set breakpoint in
>> AbstractBuiltinSpecsDetector.execute() method.
>>
>> Thanks,
>> Andrew
>>
>> On Tue, Mar 5, 2013 at 6:12 PM, Jan Baeyens <jan@xxxxxxxxxx> wrote:
>>>
>>> Hi
>>> In my eclipse plugin I have project settings that when I change them The
>>> language provider needs to be rerun because I'm using another compiler.
>>> I found a way in the gui to rerun the language provider (project
>>> properties->C/C++ General->Code Analysis->Preprocessor Include Paths,
>>> Maros
>>> etc Select providers tab; select the provider;Select reset; select OK
>>> Sometimes the reset is not enabled in which case you can change the
>>> command
>>> as work around.
>>> Eclipse spy tells me the button is on LanguageSettingProviderPage but I
>>> failed to find the code.
>>> My question is: What is the API code to force the language provider to
>>> rerun?
>>> Best regards
>>> Jantje
>>> _______________________________________________
>>> cdt-dev mailing list
>>> cdt-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>
>> _______________________________________________
>> cdt-dev mailing list
>> cdt-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top