Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 543668

Summary: [12][quick fix] Add quick fix to enable preview features
Product: [Eclipse Project] JDT Reporter: Noopur Gupta <noopur_gupta>
Component: UIAssignee: Noopur Gupta <noopur_gupta>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, noopur_gupta, sarika.sinha
Version: 4.10   
Target Milestone: BETA J12   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=543761
https://git.eclipse.org/r/136132
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=62fbfc51e1a2a536536c5a790250226e89c62d6f
Whiteboard:
Bug Depends on: 542579    
Bug Blocks: 544257, 545120    

Description Noopur Gupta CLA 2019-01-22 03:34:41 EST
Add quick fix to enable preview features i.e. checkbox in the Java Compiler Preferences.
Comment 1 Noopur Gupta CLA 2019-01-22 07:59:44 EST
If the project-specific Compiler settings are not enabled yet, then this quick fix should also ask the user if it is required to create and configure the project settings or the workspace settings.
Comment 2 Noopur Gupta CLA 2019-01-23 04:53:45 EST
Enabling preview features may need some other settings also to be changed in the compiler preferences like not using default compliance settings, changing the source compatibility etc and will need to ask if a build is required.

Hence, this quick fix should open the project properties or the preferences page for Java > Compiler settings and the user can update settings as required to enable the preview features.
Comment 3 Eclipse Genie CLA 2019-02-01 04:13:40 EST
New Gerrit change created: https://git.eclipse.org/r/136132
Comment 4 Eclipse Genie CLA 2019-02-01 04:16:53 EST
Gerrit change https://git.eclipse.org/r/136132 was merged to [BETA_JAVA_12].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=62fbfc51e1a2a536536c5a790250226e89c62d6f
Comment 5 Noopur Gupta CLA 2019-02-01 04:19:56 EST
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/136132 was merged to [BETA_JAVA_12].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=62fbfc51e1a2a536536c5a790250226e89c62d6f
Released the QF based on comment #2.

Dani, Sarika, please try it out and let me know what changes are required in this QF for bug 543761.
Comment 6 Dani Megert CLA 2019-02-07 11:22:34 EST
(In reply to Noopur Gupta from comment #5)
> (In reply to Eclipse Genie from comment #4)
> > Gerrit change https://git.eclipse.org/r/136132 was merged to [BETA_JAVA_12].
> > Commit:
> > http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=62fbfc51e1a2a536536c5a790250226e89c62d6f
> Released the QF based on comment #2.
> 
> Dani, Sarika, please try it out and let me know what changes are required in
> this QF for bug 543761.
Sorry for the late feedback.

I don't like how this works. In 99% of the cases we can just change the settings. No need to open the project settings. Only if the project settings aren't using the defaults, we can show them. And in that case the quick fix should have another label, e.g. "Open compiler settings".

There is also a mismatch between what the error message suggests (Use --enable-preview to enable) and what we show on the compiler page (Enable preview features). Maybe we should rename it in the UI, similar to "Use '--release' option. But that's another topic.


For now I suggest we don't follow up on the ideas mentioned in bug 543761.
Comment 7 Noopur Gupta CLA 2019-02-08 00:47:26 EST
(In reply to Dani Megert from comment #6)
> I don't like how this works. In 99% of the cases we can just change the
> settings. No need to open the project settings. Only if the project settings
> aren't using the defaults, we can show them. And in that case the quick fix
> should have another label, e.g. "Open compiler settings".

I have opened bug 544257 for this.
 
> There is also a mismatch between what the error message suggests (Use
> --enable-preview to enable) and what we show on the compiler page (Enable
> preview features). Maybe we should rename it in the UI, similar to "Use
> '--release' option. But that's another topic.

I will prefer not using the compiler options with '--' in the UI text. If required, we can change the text to "Enable preview features (use --enable-preview)" or if others also agree then we can change it to "Use --enable-preview".

Closing this bug. We can open new bugs to enhance it further.