Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358304 - Javascript development mode generator is not created when creating EGL basic project
Summary: Javascript development mode generator is not created when creating EGL basic ...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Song Fan CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 16:40 EDT by Jing Qian CLA
Modified: 2017-02-23 14:19 EST (History)
4 users (show)

See Also:


Attachments
Bind DevJSGen with JSGen (1.63 KB, patch)
2011-09-26 01:36 EDT, Huang Ji Yong CLA
lasher: iplog+
Details | Diff
patch (1.80 KB, patch)
2011-11-11 03:28 EST, Song Fan CLA
lasher: iplog+
Details | Diff
Patch (1.57 KB, text/plain)
2011-11-15 02:18 EST, Song Fan CLA
lasher: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jing Qian CLA 2011-09-20 16:40:21 EDT
on installable build 20110920 build

start with a clean workspace.

New => EGL project, 
give name: projA
click Finish

Open navigator view,
go to projA => .settings => org.eclipse.edt.ide.core.prefs
open this file, you can see the last line, generator Ids has 3 generators (java, javascript and javascript development genenrator), which is correct. 

generatorIds/<project>=org.eclipse.edt.ide.gen.JavaGenProvider,org.eclipse.edt.ide.gen.JavaScriptGenProvider,org.eclipse.edt.ide.gen.JavaScriptDevGenProvider


Now create another EGL project
give name: projB
click Next, (basic should already been selected)
click Next, it will show the list of compiler settings, java and javascript generators should already been selected.
click Finish

check the projB => .settings => org.eclipse.edt.ide.core.prefs file
you will find that ONLY 2 generators are created (java and javscript)
It is missing javascript development mode generator - JavaScriptDevGenProvider 

generatorIds/<project>=org.eclipse.edt.ide.gen.JavaGenProvider,org.eclipse.edt.ide.gen.JavaScriptGenProvider
Comment 1 Tony Chen CLA 2011-09-22 03:36:50 EDT
Jiyong, assigning to you. 

We have hide JavaScriptDev generator from the UI. The compiler setting wizard page will automatically check/uncheck it when JavaScript generator is check/unchecked. Bug 355201 is for that enhancement. In its comment 6, Justin mentioned below. This might be the cause of this bug. 

====from comment 6 of bug 355201===
With this implementation, if you programmatically set the JS generator, you
will not be setting the dev-mode generator. You must explicitly set the
dev-mode generator in your code if you want it enabled. We only only be turning
it on automatically when you configure the generators via our
preference/property pages.

==================================
Comment 2 Brian Svihovec CLA 2011-09-23 10:24:17 EDT
Is there some common code that can be shared between the project wizard and the preference page to set both at the same time?
Comment 3 Huang Ji Yong CLA 2011-09-26 01:36:00 EDT
Created attachment 203988 [details]
Bind DevJSGen with JSGen
Comment 4 Huang Ji Yong CLA 2011-09-26 01:54:53 EDT
Fix the problem.
The logic between preference and EGL project wizard is different. EGL project wizard have to store the generator id somewhere because when user run the wizard, the project is not created yet. So I am not sure if it can share the code with preference.
Comment 5 Lisa Lasher CLA 2011-11-09 14:13:23 EST
This high severity defect was fixed several weeks ago, so I am closing.
Comment 6 Jing Qian CLA 2011-11-10 14:19:10 EST
same issue again in 201111101033's build

when clicking next in the wizard, the project created has no generator set in the .setting/org.eclipse.edt.ide.core.prefs file
Comment 7 Song Fan CLA 2011-11-11 03:28:32 EST
Created attachment 206828 [details]
patch
Comment 8 Song Fan CLA 2011-11-11 03:29:18 EST
I think there are 3 scenarios for the compiler property setting.

1. New EGL Project==>give project name==>Click Finish

2. New EGL Project==>give project name==>Click Next==>Compiler/generator Setting(use default)==>Click Next(Finish)==>EGL build Path==>Click Finish

3. New EGL Project==>give project name==>Click Next==>Compiler/generator Setting==>Override the workspace compiler/generator settings==>Click Next==>EGL build Path==>Click Finish

For 1&2, I think the workspace setting should be used for the new project, so any information about compiler/generator should not be wrote in org.eclipse.edt.ide.core.prefs

For 3, I think proper information should be saved according to the input in the compiler/generator settings page.

Hi Jing, 
Would you please review it and give me some suggestion?
Please correct me if I'm wrong!
Comment 9 Song Fan CLA 2011-11-11 04:13:59 EST
Fixed
Comment 10 Jing Qian CLA 2011-11-11 09:27:33 EST
to Fan's comment #8,

for all of the 1&2 scenarios you described, if the workspace setting is having both java and javascript generator checked, then all 3 java, js dev, js deploy generator should be set.  Hence, the newly created project should have all 3 set, what I see is after project created, I create a library, then it only generated into javaSource and JavascriptSource, it was missing javascriptDev, which is the development mode javascript generator.

So I don't care how you store these internally, from user's point of view, I need all 3 generators(java, js dev, js deploy) to be enabled.
Comment 11 Jing Qian CLA 2011-11-11 12:21:42 EST
using 2011/11/11/0901's build

Things seem worse.

both scenario 1&2 are failing (before was only scenario #2), it only have 2 generators (java and js deploy mode),  the js development mode generator is missing
Comment 12 Song Fan CLA 2011-11-15 02:18:31 EST
Created attachment 207006 [details]
Patch

Modify the getWorkspaceGeneratorIds function
Append JS Dev generator if JS generator is selected.
Comment 13 Song Fan CLA 2011-11-15 21:01:50 EST
fixed
Comment 14 Justin Spadea CLA 2011-11-16 14:27:20 EST
The previous fix modified the API to handle this generator in a special way, but it should not have. The API should do what it's told and not mess with things under the covers. I reverted the change to ProjectSettingsUtility.java. The problem is that the default preference value did not include the dev-mode generator. I've updated the default value in EDTCorePreferenceConstants.java to include all three generators.

Previously, if you were to modify the preference page then the new value would have included the dev-mode generator; it was only a problem when the enabled generators in the preferences were never modified.
Comment 15 Jing Qian CLA 2011-11-21 14:01:25 EST
verified on 201111210901's build, thanks Justin