Community
Participate
Working Groups
A simple module-info.java like the following module example { exports org.example; } should offer a quickfix to create the package org.example if it does not exist. Granted, the compilation error will not go away, as the package is still empty, but opening the New Java Package wizard would still be helpful. (FWIW, this is the same logic as for the Create Java Class quickfix on provides...with, which is covered in Bug 522205.)
Makes sense, to some degree. In JLS speak, you'd need to create a CU declaring the package in order to create the package. That's why our Create Package wizard is not enough to resolve the error. Hence: what do you think about opening a new class / new interface wizard, with the package pre-fill and prompting the user to provide a type name? Makes more sense to me, but not sure if this will confuse users.
(In reply to Stephan Herrmann from comment #1) > In JLS speak, you'd need to create a CU declaring the package in order to > create the package. That's why our Create Package wizard is not enough to > resolve the error. True, although a package-info.java is enough to satisfy the CU requirement. That being said, I imagine the average user doesn't think about the JLS but rather about the steps he or she has to do to fix this: 1. New > Package 2. New > Class, New > Interface, ... Then my original proposal would at least automate step 1. > Hence: what do you think about opening a new class / new interface wizard, > with the package pre-fill and prompting the user to provide a type name? > Makes more sense to me, but not sure if this will confuse users. Interesting, although it probably requires *multiple* quickfixes. After all, you don't know whether the user has New > Class, New > Interface, or something else in mind for Step 2 above. But then pre-filling the package makes absolutely sense.
Based on comment #2, it will be good to open the New Package wizard when the package does not exist. In case the package exists and is empty or, after it was created by the first quick fix, we can offer other quick fixes to create class/interface etc.
New Gerrit change created: https://git.eclipse.org/r/116832
Gerrit change https://git.eclipse.org/r/116832 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=ed58658a26e4e706467b7530cf34b978b35c0be4
Sorry for the noise, the Gerrit change mentioned in the above two comments was about https://bugs.eclipse.org/bugs/show_bug.cgi?id=525803; I mistyped the bug number in the commit message.
Kalyan, it will be nice to have this for M7 if possible. We can implement it as mentioned in comment #3.
(In reply to Noopur Gupta from comment #3) > Based on comment #2, it will be good to open the New Package wizard when the > package does not exist. > > In case the package exists and is empty or, after it was created by the > first quick fix, we can offer other quick fixes to create class/interface > etc. We don't need to open a New Package wizard first. New Class/Interface/Enum/Annotation wizards will create the package if it doesn't exist yet.
New Gerrit change created: https://git.eclipse.org/r/120327
(In reply to Eclipse Genie from comment #9) > New Gerrit change created: https://git.eclipse.org/r/120327 Looks good. Please release the patch and keep the bug open to add N&N entry for M7.
Gerrit change https://git.eclipse.org/r/120327 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=c3f39dcc0a50849a596137632fa8be7b048ef1f6
New Gerrit change created: https://git.eclipse.org/r/121195
Gerrit change https://git.eclipse.org/r/121195 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=81803114e22f75d09710b4483ce6c8fb9ce00366
(In reply to Eclipse Genie from comment #13) > Gerrit change https://git.eclipse.org/r/121195 was merged to [master]. > Commit: > http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/ > ?id=81803114e22f75d09710b4483ce6c8fb9ce00366 This commit contains the N&N entry of this bug added for M7.