Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gorkem opened this issue Aug 15, 2016 · 17 comments
Closed
Assignees

Comments

@gorkem
Copy link
Contributor

gorkem commented Aug 15, 2016

From @egamma on July 11, 2016 8:20

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

@houman-babai
Copy link

houman-babai commented Feb 9, 2017

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?

@gorkem
Copy link
Contributor Author

gorkem commented Feb 9, 2017

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

@houman-babai
Copy link

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...

@concatime
Copy link

I would love to see it in future releases too!

@bowiegou
Copy link

Yes. please have this feature.

@Dangoo
Copy link

Dangoo commented Apr 5, 2017

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

@magnusart
Copy link

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?

@musiKk
Copy link

musiKk commented Jan 25, 2018

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.

@KaRkY
Copy link

KaRkY commented Feb 19, 2018

What is teh status of the issue?

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

@DiabolusExMachina
Copy link

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...

@fbricon
Copy link
Collaborator

fbricon commented Feb 23, 2018

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

@subpandu
Copy link

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

@DiabolusExMachina
Copy link

DiabolusExMachina commented Feb 28, 2018

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

@magnusart
Copy link

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.

@fbricon
Copy link
Collaborator

fbricon commented Feb 28, 2018

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

@gitorko
Copy link

gitorko commented Mar 23, 2018

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?

@angelfraga
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests