Installing custom language intepreter [message #992823] |
Sat, 22 December 2012 18:58 |
Kevin Hagel Messages: 26 Registered: December 2012 |
Junior Member |
|
|
We've developed a dltk-based IDE for our custom interpreted language, like lots of people here I suspect.
I've extended org.eclipse.dltk.launching.interpreterInstallTypes successfully, the interpreters block, all that stuff. user can find the interpreter script using the Add button. If I set up the PATH correctly user can find the interpreter using the Search button.
This has to be repeated across all workspaces however ... not all of our users are expert eclipse users who know how to export settings and so on.
I have a LaunchProject, as I see being done for the tcl, ruby, python, javascript, pde examples. They've all found a way to have their interpreter installed without my having to install it through the preference dialogs.
Where is this done?
I'd like to be able to check to see if my IInterpreterInstall is installed already, and if not install my IInterpreterInstall in the launch project plugin in the start() ... but where is this done?
|
|
|
|
Re: Installing custom language intepreter [message #997047 is a reply to message #993339] |
Thu, 03 January 2013 13:35 |
Kevin Hagel Messages: 26 Registered: December 2012 |
Junior Member |
|
|
I see now that Ruby, Python, and Tcl all require a new interpreter setting for new workspaces. PHP does not seem to need that, it finds php by itself.
I'm looking in these different IDE sources, at the plugin.xml for example to see how they start up. I run the debugger in a child instance, looking at the CorePlugin and UIPlugin as well as the language toolkits to see where and when these things are done.
Which project, the core project, the launch project, the ui project? Is it a org.eclipse.ui.startup execution so it runs independently from the startup environment the user is using i.e. which perspective is opened, is the environment waking up with a php/tcl/python etc project already in focus or in the case of a new workspace ...
I see the InterpreterSearcher being used by the InterpretersBlock. These kinds of things are all executed as a result of the user choosing them in the settings, which must be done in every new workspace. Tcl in particular provides a bunch of different possible tcl interpreter names to look for, choosing the one (I think) with the greatest version number as the default.
PHP does not seem to require this however. How does it do that?
I can find my interpreter using the InterpretersBlock and InterpreterSearcher, pretty much just by nature and interpreter name provided by extensions.
I would like to have something that finds the interpreter independent of the user settings, some background process when my custom perspective wakes up for example ensures my UI plugin is executed (where the perspective is defined).
|
|
|
Re: Installing custom language intepreter [message #1002721 is a reply to message #997047] |
Sat, 19 January 2013 08:06 |
Kevin Hagel Messages: 26 Registered: December 2012 |
Junior Member |
|
|
I did find a way to do this - in your AbstractInterpreterInstallType extension there is a method:
public IFileHandle[] detectInstallLocations()
The ancestor returns null. You can return your discovered installations, however you've managed to implement that.
This is executed in the ScriptRuntime.detectInterpreterInstall method, itself being executed in the ScriptRuntime.initializeInterpreters method.
The problem for multiple installations is seen in this comment in detectInterpreterInstall:
// Create a standin for the detected interpreter and add it to
// the result collector
// TODO (alex) handle all instances
String interpID = String.valueOf(unique);
InterpreterStandin detected = new InterpreterStandin(
interpType, interpID);
detected.setInstallLocation(detectedLocations[0]);
detected.setName(interpType
.generateDetectedInterpreterName(detected
.getInstallLocation()));
return detected;
Since I have to set one of my interpreter installations as default I just return that one. Extra installations can be deal with in the Search ...
Is there going to be any new releases of DLTK in the future, or has development ended?
[Updated on: Sat, 19 January 2013 08:15] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02226 seconds