8000 .editorconfig configuration is not taken into account when formatting code · Issue #31 · angelozerr/ec4e · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

.editorconfig configu 8000 ration is not taken into account when formatting code #31

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

Open
nagromc opened this issue Nov 15, 2017 · 4 comments

Comments

@nagromc
Copy link
nagromc commented Nov 15, 2017

When Ctrl + A > Ctrl + Shift + F, the .editorconfig configuration is not taken into account.

The following code

public class Foo {

	public void bar() {
		int i = 0;
	}

}

will be converted as

public class Foo {

    public void bar() {
        int i = 0;
    }

}

.editorconfig:

root = true

[*]
insert_final_newline = true
charset = utf-8
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true

Works well with https://github.com/ncjones/editorconfig-eclipse or https://github.com/sindresorhus/atom-editorconfig.

I don't if it is possible to generate a technical report to help you to investigate.

@angelozerr
Copy link
Owner

Which editor do you use it?

If it's with JDT Java Editor, it will not work, ec4e is working only with Generic Editor.

@nagromc
Copy link
Author
nagromc commented Nov 15, 2017

That's right. I'm using the Java editor. Is it planed to support it?

@nagromc
Copy link
Author
nagromc commented Nov 15, 2017

OK I missed the main page which states

...and works only with GenericEditor

Well, I didn't realize that wouldn't work with the Java editor. Sorry for the mess.

@angelozerr
Copy link
Owner
angelozerr commented Nov 15, 2017

That's right. I'm using the Java editor. Is it planed to support it?

No it's not possible to support it because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=457046#c14

As JDT re-read indent style, etc from the preferences (project or workspace), you can use my strategy which search value from a custom IPreferenceStore. The only solution to work with JDT is to update project or workspace preferences each time the editor takes the focus like https://github.com/ncjones/editorconfig-eclipse does.

I found not this solution very elegant, that's why I have created ec4e which works only with Generic Editor because Generic Editor doesn't re-read properties of indent, etc from a preferences but from a preference store (default behaviour of TextEditor).

I hope one day JDT will switch to Generic Editor and after we could benefit with ec4e.

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

No branches or pull requests

2 participants
0