Skip to content

vscode-extension: Provide an action to open the formatter settings file #2

Closed

Description

@gorkem

From @egamma on July 11, 2016 8:20

Copied from original issue: eclipse-jdtls/eclipse.jdt.ls#42

Activity

  1. houman-babai commented on Feb 9, 2017

    @houman-babai

    I wanted to open an enhancement-request to provide a configuration surface for the formatter. Currently I use eclipse, and I would like to move over to vs code. But I do need a way to format the code according to a formatting policy.

    Is this ticket addressing the same problem?

  2. gorkem commented on Feb 9, 2017

    @gorkem
    ContributorAuthor

    @houman-babai Yes, this is a request to use and edit eclipse formatting policies

  3. houman-babai commented on Feb 9, 2017

    @houman-babai

    Thanks @gorkem. This is a great tool, but unfortunately I cannot use it without the formatter. Over the next few month I'll see if I can learn to contribute to the project :-) In the meantime i would be grateful to know if there are any workarounds...

  4. concatime commented on Mar 19, 2017

    @concatime

    I would love to see it in future releases too!

  5. bowiegou commented on Mar 26, 2017

    @bowiegou

    Yes. please have this feature.

  6. Dangoo commented on Apr 5, 2017

    @Dangoo

    I'd vote for that too!
    @gorkem any hints where one could find the configuration for formating-rule, might find some time to contribute…

  7. magnusart commented on Jul 7, 2017

    @magnusart

    This is very annoying. We have a specialized eclipse formatting settings but when using visual code I muck that up and there is no documented way to change it. Is there any workaround?

  8. musiKk commented on Jan 25, 2018

    @musiKk

    FWIW there is a maven plugin which uses the Eclipse formatter and can use any provided formatting configuration. A native solution would be better of course.

  9. KaRkY commented on Feb 19, 2018

    @KaRkY

    What is teh status of the issue?

    It is the only thing preventing me from using this instead of eclipse proper.

  10. DiabolusExMachina commented on Feb 23, 2018

    @DiabolusExMachina

    Any news on this? I think this is really important.

    Even a property like "java.formater.file" in vscode to point to my global company rules would really help. I don't want to copy the file in all of our projects by hand...

  11. fbricon commented on Feb 23, 2018

    @fbricon
    Collaborator

    Sorry guys, there's been no new development in that area yet. As a workaround for your formatting options, please read https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings

  12. subpandu commented on Feb 26, 2018

    @subpandu

    Trying to use the given workaround, how do you tell vscode to pick the formatting rules from .settings/org.eclipse.jdt.core.prefs

    Just including the file in the project did not work

  13. DiabolusExMachina commented on Feb 28, 2018

    @DiabolusExMachina

    Yes moving the file to the .settings folder does not seem to work

  14. magnusart commented on Feb 28, 2018

    @magnusart

    I can recommend the gradle/maven plugin spotless as a work around (https://github.com/diffplug/spotless). Your build tool then makes sure everything is formatted. It can reformat your code automatically via the command spotlessApply. Not a replacement but makes things more tolerable and enforces a single code formatting standard.

  15. fbricon commented on Feb 28, 2018

    @fbricon
    Collaborator

    can anyone provide a sample project where .settings/org.eclipse.jdt.core.prefs are ignored?

  16. gitorko commented on Mar 23, 2018

    @gitorko

    After copying the .settings/org.eclipse.jdt.core.prefs file you need to restart vscode for the changes to be picked. It was working for me after restart. 1.21.1 version. However now i have to copy this file to each project to get formatting to work. Is there a global location to place this file?

  17. angelfraga commented on Apr 6, 2018

    @angelfraga

    I would like to see this feature in the next releases. In spite of the workaround works fine, could be great declared in vscode user settings a global ./settings folder to use for each project. Also, for example, org.eclipse.jdt.ui.prefs is needed as well to sort import statements.

  18. added this to the End April 2018 milestone on Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions