Composer-Eclipse-Plugin icon indicating copy to clipboard operation
Composer-Eclipse-Plugin copied to clipboard

Set indentation style for composer.json

Open hason opened this issue 11 years ago • 6 comments

I prefer spaces over tabs ;)

hason avatar Apr 17 '13 10:04 hason

To improve this over all available editors, i've created a couple of issues:

  • [ ] https://github.com/pdt-eg/Core-Plugin/issues/49
  • [ ] https://github.com/pulse00/Json-Eclipse-Plugin/issues/4
  • [ ] https://github.com/oyse/yedit/issues/11

pulse00 avatar Apr 17 '13 10:04 pulse00

@gossi this will be more annoying than i thought it would be:

https://github.com/pulse00/Composer-Java-Bindings/blob/master/java-api/src/main/java/com/dubture/getcomposer/core/utils/JsonFormatter.java#L13

Making \t configurable here means a lot of work in the java-api ;)

pulse00 avatar Apr 17 '13 21:04 pulse00

Spaces suck! :tongue: (edit: that tongue looks really ugly!)

I thought about a formatter for the Json Editor. Where indentation character and count can be configured. May be worth it's own project an consumed by the mentioned libs/plugins. And then the Composer-Plugin can use the formatter from the Json Editor, which sounds better to me than an integration into the composer-plugin itself.

gossi avatar Apr 17 '13 22:04 gossi

@gossi actually the embedded json editor already has options for that, see

What i meant with the EditorConfig support is that these preferences should be set automatically if an .editorconfig file is present in the project.

The thing is: We'd need to inject those preferences somehow into the above mentioned formatter.

pulse00 avatar Apr 18 '13 06:04 pulse00

I read about EditorConfig past my post. It's a neat idea, actually should get mainstream support from eclipse. Here is the related bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389139 So it doesn't look like that. And actually, at least indentation stuff is related to each plugin. So, which plugin is the proper target to support .editorconfig? I'd stick with the Json Eclipse Plugin, what you think?

Ref: https://groups.google.com/forum/?fromgroups=#!topic/editorconfig/0TYJ4AciIYg Two people wanted to implemented editorconfig into eclipse, not yet done.

gossi avatar Apr 18 '13 14:04 gossi

Yeah, regarding this issue here i'd say there are 2 tasks:

  1. Pass down the indentation property / configuration from the Json-Eclipse-Plugin to the JsonFormatter of the java-api.
  2. Add support for .editorconfig in the Json-Eclipse-Plugin

Btw: there is a global setting in the Eclipse preferences for this:

Screen Shot 2013-04-18 at 4 22 33 PM

So the question is: Why do editors implement custom indentation settings in the first place and don't use the global settings?

That would make .editorconfig integration even easier.

pulse00 avatar Apr 18 '13 14:04 pulse00