Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] interpreter install and 'internal' scripts

Hi Jae,
> hello all -
>
>   i would like to get my source parser working again, and in order to
> do that, i need to obtain an IInterpreterInstall instance to execute
> my parser script.
>
>   i am currently obtaining an instance of the InterpreterInstall using
> this call:
>
>     IInterpreterInstall install =
> ScriptRuntime.getInterpreterFromCompositeId(id);
Where is no changes in ScriptRuntime.getInterpreterFromCompositeId() so
you could use it as before.
>
>   would this still be the correct thing to do given the recent
> interpreter changes? i'm obtaining the 'id' from a preference store
> value, but if that value isn't set, i want to get whatever the default
> interpreter is for the user's environment and use that. in order to
> populate the values for the preference page, i do this:
>
>    private IInterpreterInstall[] getInterpreterInstalls() {
>         List interpreters = new ArrayList();
>         IInterpreterInstallType[] types = ScriptRuntime
>                 .getInterpreterInstallTypes(getNatureId());
>         for (int i = 0; i < types.length; i++) {
>             IInterpreterInstall[] installs =
> types[i].getInterpreterInstalls();
>             for (int j = 0; j < installs.length; j++) {
>                 interpreters.add(installs[j]);
>             }
>     }
>
>   is that also correct at this point?
Yes this is correct, but this will give you interpreters for all
environment's.
>
>   if it is, how can i obtain the default InterpreterInstall for the
> user's local environment?
For getting default interpreters for local environment please use
following snippet:
String nature = ...
String environmentId = LocalEnvironment.ENVIRONMENT_ID;
ScriptRuntime.getDefaultInterpreterInstall(new
DefaultInterpreterEntry(nature, environmentId));


Also Jae:
Do you have you DLTK based Perl implementation source in public access?
If it is I've could check it out and send you patches if we made some
broke changes.

Best regards, Andrei Sobolev.
>
> -- 
> -jae
> ------------------------------------------------------------------------
>
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev
>   



Back to the top