I am currently learning Java. I copy/paste a lot of source files from the internet, which sometimes have inconsistent tab sizes.
I work with Atom and installed EditorConfig to fix files I download. They come with 2, 3 or 4 spaces and as well as hard or soft tabs (spaces). I noticed EditorConfig in Atom does not seem to correct the tabs in any file I try. I have Tab Type in Settings -> Editor set to auto.
For instance, in the following file, each indentation is filled with 2 spaces:
public class HelloWorld {
public static int x = 7;
public int y = 3;
public static void main(String[] args) {
System.out.println("Hello World!");
HelloWorld a = new HelloWorld();
HelloWorld b = new HelloWorld();
a.y = 5;
b.y = 6;
a.x = 1;
b.x = 2;
System.out.println("a.y = " + a.y);
System.out.println("b.y = " + b.y);
System.out.println("a.x = " + a.x);
System.out.println("b.x = " + b.x);
System.out.println("HelloWorld.x = " + HelloWorld.x);
}
}
When I run EditorConfig: Fix File, I get the message:
HelloWorld.java
The file HelloWorld.java conformed to the end_of_line and indent_style properties. No changes were applied.
It seems like EditorConfig considers the file to be correct while it is not, at least according to the .edutorconfig file I shared below. I also run EditorConfig: Show State and got this message:
No problems affecting HelloWorld.java
The editorconfig was applied successfully and the editor for this file should work as expected. If you face any unexpected behavior please report the issue to us
Active Configuration
EditorConfig settings Current values
charset utf8
end_of_line \n
indent_size / tab_width 4
indent_style space
insert_final_newline true
max_line_length unset
trim_trailing_whitespace true
Note: unset means atom-editorconfig is not influencing a property's behaviour. A full description of all properties can be found on editorconfig.org or their project's Wiki
Is it a bug or have I installed anything that prevents EditorConfig from working?
Hello,
I am currently learning Java. I copy/paste a lot of source files from the internet, which sometimes have inconsistent tab sizes.
I work with Atom and installed EditorConfig to fix files I download. They come with 2, 3 or 4 spaces and as well as hard or soft tabs (spaces). I noticed EditorConfig in Atom does not seem to correct the tabs in any file I try. I have
Tab Type
inSettings -> Editor
set toauto
.For instance, in the following file, each indentation is filled with 2 spaces:
When I run
EditorConfig: Fix File
, I get the message:It seems like EditorConfig considers the file to be correct while it is not, at least according to the
.edutorconfig
file I shared below. I also runEditorConfig: Show State
and got this message:Is it a bug or have I installed anything that prevents EditorConfig from working?
Thanks
EDIT. My OS is Ubuntu 20.04 LTS.
Involved .editorconfig-files
Directory structure
Installed packages