Skip to content
This repository has been archived by the owner on May 29, 2021. It is now read-only.

When analyzing my file It's not respecting indents #29

Open
hectorfhurtado opened this issue May 21, 2015 · 2 comments
Open

When analyzing my file It's not respecting indents #29

hectorfhurtado opened this issue May 21, 2015 · 2 comments

Comments

@hectorfhurtado
Copy link

I specified dart-tools on Setting to be 4 on 'Tab length' but It format all my code on 2. I tried with all values on list and the result is the same: using a 2 tab length.

I like to put spaces between square brackets and parenthesis but It's not respecting that either. For example, from this:

void abrirCarpetaConMibs() {
    new Directory( Directory.current.path + PATH_MIBS )
        .list( recursive: true )
        .listen(( FileSystemEntity f ) {
        if ( f is File ) {
            if ( new RegExp( '\.mib' ).hasMatch( f .path )) {
                archivosMib.add( f.path );
            }
        } else if ( f is Directory ) {
            print( f );
        }
    }, onDone: () => print(new File( archivosMib[ 0 ]).readAsStringSync() ));
}

to this:

void abrirCarpetaConMibs() {
  new Directory(Directory.current.path + PATH_MIBS)
      .list(recursive: true)
      .listen((FileSystemEntity f) {
    if (f is File) {
      if (new RegExp('\.mib').hasMatch(f.path)) {
        archivosMib.add(f.path);
      }
    } else if (f is Directory) {
      print(f);
    }
  }, onDone: () => print(new File(archivosMib[0]).readAsStringSync()));
}
@radicaled
Copy link
Owner

I think you mean formatting.

Dart's formatter doesn't have any options, so to speak: it enforces the Dart style guide, which is 2 space indents.

Bob Nystrom, the person behind the Dart style guide and dartfmt, hangs out at https://www.dartlang.org/mailing-list -- if you manage to convince him to make indentation configurable, I'll update the plugin so that it checks Atom's indentation level and then utilizes that.

@hectorfhurtado
Copy link
Author

Openned issue 23511

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

No branches or pull requests

2 participants