Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » Two questions - interpreter library configuration and NewSourceModulePage
Two questions - interpreter library configuration and NewSourceModulePage [message #20683] Fri, 08 February 2008 18:17 Go to next message
Eclipse UserFriend
Originally posted by: a0309169.unet.univie.ac.at

Hello,

I'm currently in the process of constructing an editor plug-in which
(obviously) utilizes DLTK to provide some functionality.

Since the code of the tutorial plug-in at
http://wiki.eclipse.org/DLTK_IDE_Guide does not seem to be available
anymore, I've downloaded the source of the Ruby plug-in and currently,
based on that, I'm exploring DLTK's functionality.

So far, I've ran into two problems which I couldn't immediately handle:

1. I'm using DLTK facilities to handle interpreter configuration. I have
a problem with AddScriptInterpreterDialog - it requires setting a
default library for the dialog to proceed. I haven't found a way to
automagically configure a default library. Additionally, the language
I'm creating the editor for doesn't even HAVE a concept of a "library".

In short, my question is - how can I get around the problem of setting
the library configuration for the dialog?

2. I've created a new file wizard utilizing NewSourceModuleWizard .
Unfortunately, I receive exceptions when typing in the file name field
of the wizard's Page, namely:

java.lang.NullPointerException
at
org.eclipse.dltk.ui.wizards.NewSourceModulePage.getFileExten sions(NewSourceModulePage.java:197)
at
org.eclipse.dltk.ui.wizards.NewSourceModulePage.getFileName( NewSourceModulePage.java:182)
at
org.eclipse.dltk.ui.wizards.NewSourceModulePage.fileChanged( NewSourceModulePage.java:59)
at
org.eclipse.dltk.ui.wizards.NewSourceModulePage.access$0(New SourceModulePage.java:51)
at
org.eclipse.dltk.ui.wizards.NewSourceModulePage$1.dialogFiel dChanged(NewSourceModulePage.java:105)
at
org.eclipse.dltk.internal.ui.wizards.dialogfields.DialogFiel d.dialogFieldChanged(DialogField.java:68)
at
org.eclipse.dltk.internal.ui.wizards.dialogfields.StringDial ogField.doModifyText(StringDialogField.java:131)
at
org.eclipse.dltk.internal.ui.wizards.dialogfields.StringDial ogField.access$0(StringDialogField.java:127)
at
org.eclipse.dltk.internal.ui.wizards.dialogfields.StringDial ogField$1.modifyText(StringDialogField.java:109)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:166)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
[...]

However:
-the language toolkit class' getLanguageFileExtensions() method is
implemented with a non-null return value,
-the NewSourceModulePage's getRequiredNature() points to the
corresponding language nature.

What could be another cause for this problem?

Thanks in advance for any help
Re: Two questions - interpreter library configuration and NewSourceModulePage [message #20698 is a reply to message #20683] Wed, 13 February 2008 15:30 Go to previous messageGo to next message
Andrei Sobolev is currently offline Andrei SobolevFriend
Messages: 72
Registered: July 2009
Member
Hi Mikolaj,
> Hello,
>
> I'm currently in the process of constructing an editor plug-in which
> (obviously) utilizes DLTK to provide some functionality.
>
> Since the code of the tutorial plug-in at
> http://wiki.eclipse.org/DLTK_IDE_Guide does not seem to be available
> anymore, I've downloaded the source of the Ruby plug-in and currently,
> based on that, I'm exploring DLTK's functionality.

Yes version is outdated, we plan to deliver new improved tutorial to 17 of February,
But you could look to example code from
dev.eclipse.org/cvsroot/technology/org.eclipse.dltk/examples /eclipsecon08/org.eclipse.dltk.examples.python.

>
> So far, I've ran into two problems which I couldn't immediately handle:
>
> 1. I'm using DLTK facilities to handle interpreter configuration. I have
> a problem with AddScriptInterpreterDialog - it requires setting a
> default library for the dialog to proceed. I haven't found a way to
> automagically configure a default library. Additionally, the language
> I'm creating the editor for doesn't even HAVE a concept of a "library".
>
> In short, my question is - how can I get around the problem of setting
> the library configuration for the dialog?

Current HEAD version allow configuring of interpreters without any library specified.

>
> 2. I've created a new file wizard utilizing NewSourceModuleWizard .
> Unfortunately, I receive exceptions when typing in the file name field
> of the wizard's Page, namely:
>
> java.lang.NullPointerException
> at
> org.eclipse.dltk.ui.wizards.NewSourceModulePage.getFileExten sions(NewSourceModulePage.java:197)
>
> at
> org.eclipse.dltk.ui.wizards.NewSourceModulePage.getFileName( NewSourceModulePage.java:182)
>
> at
> org.eclipse.dltk.ui.wizards.NewSourceModulePage.fileChanged( NewSourceModulePage.java:59)
>
> at
> org.eclipse.dltk.ui.wizards.NewSourceModulePage.access$0(New SourceModulePage.java:51)
>
> at
> org.eclipse.dltk.ui.wizards.NewSourceModulePage$1.dialogFiel dChanged(NewSourceModulePage.java:105)
>
> at
> org.eclipse.dltk.internal.ui.wizards.dialogfields.DialogFiel d.dialogFieldChanged(DialogField.java:68)
>
> at
> org.eclipse.dltk.internal.ui.wizards.dialogfields.StringDial ogField.doModifyText(StringDialogField.java:131)
>
> at
> org.eclipse.dltk.internal.ui.wizards.dialogfields.StringDial ogField.access$0(StringDialogField.java:127)
>
> at
> org.eclipse.dltk.internal.ui.wizards.dialogfields.StringDial ogField$1.modifyText(StringDialogField.java:109)
>
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:166)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> [...]
>
> However:
> -the language toolkit class' getLanguageFileExtensions() method is
> implemented with a non-null return value,
> -the NewSourceModulePage's getRequiredNature() points to the
> corresponding language nature.

This could only happen if language toolkit extension point is not correctly contributed.
Please check plugin.xml.
Also you could write simple JUnit test with following code:

IDLTKLanguageToolkit toolkit = DLTKLangaugeManager.getLanguageToolkit("org.eclipse.dltk.tcl.core.nature ");

Best regards,
Andrei Sobolev.
Re: Two questions - interpreter library configuration and NewSourceModulePage [message #20711 is a reply to message #20698] Wed, 13 February 2008 19:47 Go to previous message
Eclipse UserFriend
Originally posted by: a0309169.unet.univie.ac.at

Hello, Andrei,

> Hi Mikolaj,
>> Hello,
>>
>> I'm currently in the process of constructing an editor plug-in which
>> (obviously) utilizes DLTK to provide some functionality.
>>
>> Since the code of the tutorial plug-in at
>> http://wiki.eclipse.org/DLTK_IDE_Guide does not seem to be available
>> anymore, I've downloaded the source of the Ruby plug-in and currently,
>> based on that, I'm exploring DLTK's functionality.
>
> Yes version is outdated, we plan to deliver new improved tutorial to 17 of February,

Super! DLTK has great potential, but it badly needs introductory
documentation, so what you said is good news.

I would like to supply some pointers in relation to the guide, if it's
not too late:
1. An expanded section on parser construction would prove very useful -
especially on the subject of DLTK AST's structure and usage by the
toolkit. This is something a code-only example does not describe well
unfortunately.
2. Expand on the various UI contributions (especially the editor) - but
I bet you already got into that :).


> But you could look to example code from
> dev.eclipse.org/cvsroot/technology/org.eclipse.dltk/examples /eclipsecon08/org.eclipse.dltk.examples.python.
>

Yup, already seen them, but had some compile errors, obviously due to
version mismatch (I have 0.9 currently, and the examples probably
require the CVS version). No matter, I'll look into them again.

>> So far, I've ran into two problems which I couldn't immediately handle:
>>
>> 1. I'm using DLTK facilities to handle interpreter configuration. I have
>> a problem with AddScriptInterpreterDialog - it requires setting a
>> default library for the dialog to proceed. I haven't found a way to
>> automagically configure a default library. Additionally, the language
>> I'm creating the editor for doesn't even HAVE a concept of a "library".
>>
>> In short, my question is - how can I get around the problem of setting
>> the library configuration for the dialog?
>
> Current HEAD version allow configuring of interpreters without any library specified.
>

OK, time for me to check it out then (pun intended ;)).

>> 2. I've created a new file wizard utilizing NewSourceModuleWizard .
>> Unfortunately, I receive exceptions when typing in the file name field
>> of the wizard's Page, namely:
>>
>> java.lang.NullPointerException
>> at
>> org.eclipse.dltk.ui.wizards.NewSourceModulePage.getFileExten sions(NewSourceModulePage.java:197)
>>
>> [...]
>>
>> However:
>> -the language toolkit class' getLanguageFileExtensions() method is
>> implemented with a non-null return value,
>> -the NewSourceModulePage's getRequiredNature() points to the
>> corresponding language nature.
>
> This could only happen if language toolkit extension point is not correctly contributed.
> Please check plugin.xml.
> Also you could write simple JUnit test with following code:
>
> IDLTKLanguageToolkit toolkit = DLTKLangaugeManager.getLanguageToolkit("org.eclipse.dltk.tcl.core.nature ");
>
> Best regards,
> Andrei Sobolev.

Yes, this was the problem - the "nature" field's value for the
org.eclipse.dltk.core.language extension point contribution was invalid
(stupid copy+paste from the contributing class field for the nature).

Thanks for the help and the information!

Cheers,
Mikolaj
Previous Topic:Custom Views that depend on SourceModule
Next Topic:Can't debug with JRuby
Goto Forum:
  


Current Time: Tue Apr 23 12:31:22 GMT 2024

Powered by FUDForum. Page generated in 0.03369 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top