Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bettercallshao/indent-sorter


https://github.com/bettercallshao/indent-sorter

Last synced: 28 days ago
JSON representation

Awesome Lists containing this project

README

        

# indent-sorter

A Visual Studio Code extension that sorts blocks of highlighted code grouped by indentation. Sorting is keyed on the first line in the block that is not a comment.

## Example

Before

```ruby
# comment
z_is_not_a_method

# This is a ruby comment
def B
call_method
end

def A
# empty method
end
```

After

```ruby
def A
# empty method
end

# This is a ruby comment
def B
call_method
end

# comment
z_is_not_a_method
```

![demo](https://i.imgur.com/KjvZYsY.gif)

More examples in [src/test/indent-sorter/](src/test/indent-sorter/)