Bug 181306 - InterpreterContainer is "unbound" if script nature isn't first in .project file
Summary: InterpreterContainer is "unbound" if script nature isn't first in .project file
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: 0.9   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mikhail Kalugin CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-04-05 16:15 EDT by Shelby Sanders CLA
Modified: 2008-05-26 02:43 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shelby Sanders CLA 2007-04-05 16:15:22 EDT
Build ID: M20070212-1330

Steps To Reproduce:
1.Create a Ruby Project
2.Edit the .project file to include a nature before the Ruby nature
3.Inspect "Interpreter Libraries" node in "Script Explorer".  Note that it is marked "[unbound]", and doesn't have any children.

More information:
I tracked this down to "InterpreterContainerInitializer.getNatureFromProject()" looking for the first enabled nature.  I believe that method should also check if the nature is a script nature.

I fixed the issue by changing line InterpreterContainerInitializer:123 to
<pre>
if (proj.isNatureEnabled(natures[i]) && DLTKLanguageManager.isScriptNature(natures[i]))
</pre>

and adding the following to DLTKLanguageManager
<pre>
    public static boolean isScriptNature(String natureId) {
        return toolkits.containsKey(natureId);
    }
</pre>
Comment 1 Andrey Platov CLA 2007-04-05 16:46:30 EDT
Mike, please apply (Andrey is overbooked with builders)
Comment 2 Mikhail Kalugin CLA 2007-04-06 01:32:31 EDT
In fact, there should be only one line:
return DLTKLanguageManager.getLanguageToolkit(project).getNatureID();
:)

I've fixed it, thanks.
Comment 3 Andrey Platov CLA 2008-05-26 02:43:54 EDT
bulk change: this bug was fixed in DLTK 0.9