This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 421934 - Enable save actions for org.eclipse.jface and jface databinding examples
Summary: Enable save actions for org.eclipse.jface and jface databinding examples
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 4.5 M2   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 49619
Blocks: 420779
  Show dependency tree
 
Reported: 2013-11-18 03:32 EST by Lars Vogel CLA
Modified: 2014-09-16 04:58 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2013-11-18 03:32:32 EST
I suggest to enable the save actions on org.eclipse.jface and the jface snippets plug-ins to make it easier for contributors to deliver patches without issues.
Comment 1 Lars Vogel CLA 2013-11-18 05:31:48 EST
https://git.eclipse.org/r/18487
Comment 3 Paul Webster CLA 2013-11-18 09:52:19 EST
This change must be reverted.  I added a method to a class in JFace and it reformatted the entire class.

I don't mind minor changes, see how we do it in o.e.ui.workbench, but it can't reformat the entire class when I add one method.

PW
Comment 4 Lars Vogel CLA 2013-11-18 10:15:39 EST
I set the save action to format only the edited lines. I assume the "Correct intention" might have cause this issue. Also Bug 49619 seems to add whitespace to Javadoc. I revert the change and wait for the solution of 49619 to enable it again without "Correct intension".
Comment 6 Lars Vogel CLA 2014-02-20 06:03:51 EST
New Gerrit review

https://git.eclipse.org/r/22293
Comment 8 Lars Vogel CLA 2014-02-28 06:45:31 EST
Verified in Git
Comment 9 Markus Keller CLA 2014-08-11 11:35:34 EDT
This is insane. When you enable formatting on Save, you have to at least store project-specific formatter settings as well.

> Make it easier

That's purely subjective. For me, it's impossible to work efficiently in a project that automatically breaks my formatting on save. And to make complicated code more readable, you can't always rely on an automatic formatter that can't know about semantics and interesting similarities in code fragments (e.g. put line break where it makes sense).

I'm fine with releasing a formatter profile, but forcing auto-mangling by the formatter on save is hardly making anything easier.
Comment 10 Lars Vogel CLA 2014-08-11 11:44:24 EDT
(In reply to Markus Keller from comment #9)
> This is insane. When you enable formatting on Save, you have to at least
> store project-specific formatter settings as well.

I think "insane" is a very bad error description. What problem do you face? 

AFAIK platform.ui does not use project specific formatter. And most platform.ui projects use "Save actions" with "Format edited lines" which AFAICS is also used for JFace.
Comment 11 Lars Vogel CLA 2014-08-11 11:46:17 EDT
(In reply to Lars Vogel from comment #10)
> And most
> platform.ui projects use "Save actions" with "Format edited lines" which
> AFAICS is also used for JFace.

See for example org.eclipse.jdt.ui.prefs in org.eclipse.e4.ui.di from Paul. I think that was the example I used as template (not sure, its been a while).
Comment 12 Markus Keller CLA 2014-08-11 12:17:39 EDT
(In reply to Lars Vogel from comment #10)
> (In reply to Markus Keller from comment #9)
> > This is insane. When you enable formatting on Save, you have to at least
> > store project-specific formatter settings as well.
> 
> I think "insane" is a very bad error description. What problem do you face?

My workspace formatting profile is not exactly the same as existing code in org.eclipse.jface, so whenever I save a file, changed lines are jumping around and badly formatted.

If you like Format on Save, then why don't you just enable it in your workspace?
Comment 13 Paul Webster CLA 2014-08-11 12:31:45 EDT
(In reply to Markus Keller from comment #12)
> (In reply to Lars Vogel from comment #10)
> > (In reply to Markus Keller from comment #9)
> > > This is insane. When you enable formatting on Save, you have to at least
> > > store project-specific formatter settings as well.
> > 
> > I think "insane" is a very bad error description. What problem do you face?
> 
> My workspace formatting profile is not exactly the same as existing code in
> org.eclipse.jface, so whenever I save a file, changed lines are jumping
> around and badly formatted.
> 
> If you like Format on Save, then why don't you just enable it in your
> workspace?

It should be enabled as in org.eclipse.ui.workbench.  See Bug 258729

AFAICT that includes a specific formatter profile (it's per project, and should be used for the other Platform UI bundles as well)

PW
Comment 14 Dani Megert CLA 2014-08-11 13:29:55 EDT
(In reply to Paul Webster from comment #13)
> It should be enabled as in org.eclipse.ui.workbench.  See Bug 258729
> 
> AFAICT that includes a specific formatter profile (it's per project, and
> should be used for the other Platform UI bundles as well)
> 
> PW

For me it's acceptable to enable formatting edited lines if the profile is also stored with the project. Otherwise it drives the developer insane ;-).
Comment 15 Markus Keller CLA 2014-08-11 14:09:25 EDT
Note that the Eclipse default line length is 120 now, so you may want to use this in the profile.
Comment 16 Paul Webster CLA 2014-08-11 14:41:04 EDT
(In reply to Markus Keller from comment #15)
> Note that the Eclipse default line length is 120 now, so you may want to use
> this in the profile.

If that's the case I'm fine with updating that too.

PW
Comment 17 Lars Vogel CLA 2014-08-11 14:57:00 EDT
(In reply to Paul Webster from comment #16)
> (In reply to Markus Keller from comment #15)
> > Note that the Eclipse default line length is 120 now, so you may want to use
> > this in the profile.
> 
> If that's the case I'm fine with updating that too.

According to https://bugs.eclipse.org/bugs/show_bug.cgi?id=258729#c24 the line length was the only specific setting in the formatter. So we can switch back to the "Eclipse build-in" formatter. Correct?
Comment 18 Paul Webster CLA 2014-08-11 15:00:51 EDT
(In reply to Lars Vogel from comment #17)
> 
> According to https://bugs.eclipse.org/bugs/show_bug.cgi?id=258729#c24 the
> line length was the only specific setting in the formatter. So we can switch
> back to the "Eclipse build-in" formatter. Correct?

As long as that makes it so that if someone gets the project and it auto-saves, it uses the correct profile I'm fine with that.

PW
Comment 20 Lars Vogel CLA 2014-09-16 04:58:30 EDT
.