Giter Club home page Giter Club logo

scoped-sort's People

Contributors

kitesi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

scoped-sort's Issues

YAML sort-start comments

Thanks for this extension. I'd like to use it with YAML using sort-start and sort-end comments. Is this possible now or am I making a feature suggestion?

packages:
# sort-start --regex /[^\/]/
  - ./pkg-test/
  - ./pkg/
# sort-end

Handle starting line not being outermost indentation

This program assumes the first non blank line of the given text is the outermost indentation level.

Examples:

- some text
- follow up
  - subtext
- other text
    - this also works
    - fine
    - aswell
      - subtext

These both sort fine, but what doesn't work is if you go a level back from the starting indentation.

    - this also works
    - fine
    - aswell
      - subtext
- now I'm here

It's not clear what the expected sort should be here. Possibly moving the last line to the first line, but that would make all the other lines look like children of "now I'm here".

For now it's undefined behavior, and your text probably shouldn't be formatted in this way anyways.

Help needed

Hello. I had a use-case and I've searched a lot of extensions but was unable to find an appropriate one. Wondering if this can achieved using yours!

So I have a bunch of HTML blocks like this:

<div class="parent">
    <div class="child">
        <h3>Zachary Garrett</h3>
        <p>foo bar baz</p>
        <div class="something">
            lorem ipsum
        </div>
    </div>
    <div class="child">
        <h3>Elijah Tyler</h3>
        <p>foo bar baz</p>
        <div class="something">
            lorem ipsum
        </div>
    </div>
    <div class="child">
        <h3>Earl Henry</h3>
        <p>foo bar baz</p>
        <div class="something">
            lorem ipsum
        </div>
    </div>
    <div class="child">
        <h3>Herman Reed</h3>
        <p>foo bar baz</p>
        <div class="something">
            lorem ipsum
        </div>
    </div>
</div>

I want to sort the .child blocks according to the h3 values. So the result would look like:

<div class="parent">
    <div class="child">
        <h3>Earl Henry</h3>
        <p>foo bar baz</p>
        <div class="something">
            lorem ipsum
        </div>
    </div>
    <div class="child">
        <h3>Elijah Tyler</h3>
        <p>foo bar baz</p>
        <div class="something">
            lorem ipsum
        </div>
    </div>
    <div class="child">
        <h3>Herman Reed</h3>
        <p>foo bar baz</p>
        <div class="something">
            lorem ipsum
        </div>
    </div>
    <div class="child">
        <h3>Zachary Garrett</h3>
        <p>foo bar baz</p>
        <div class="something">
            lorem ipsum
        </div>
    </div>
</div>

Can I achieve that somehow using this extension? Thanks.

Change Sort on Save to not sort all saved files

I love the idea of Sort on Save, but started noticing weird changes to files not marked with the { sort-start } section.
Didn't realize this would be applied to a whole file if the section was not applied, which is not an expected experience.
I had to turn off this feature and return to manually highlighting and sorting a section.

Please provide a means of sorting a whole file if the { sort-start } section is not defined.

Recent changes have broken outline sorting

The following markdown task list had been sorting correctly until the recent update.
Now the first lines of each grouping are shifting down one. i.e. - [x] (a0) shifts into the - [ ] (a1) location, and that line shifts down to

Note: I have removed my own content of each task, but this process had previously sorted correctly so that I could mark things as done and the next undone task would sort to the top.

Provider: VS Code Extension
Version: v3.0.0
Options: Format Sections on Save - using the sort options within the comment

Initial List

<!-- { sort-start -r } -->
 
- [x] (a0) 
  - [x] (1)
  - [x] (2) 
    - review [open tasks](searches\open-tasks.code-search)
  - [x] (3) 
  - [x] (4) 
    - [x] 1) 
    - [x] 2) 
    - [x] 3) 
      - comment 1
      - comment 2
      - comment 3
    - [x] 4) 
    - [x] 5) 
      - comment 1
        - comment 1.a
  
- [ ] (a1) 
  - comment 1 
    - comment 1.a
    - comment 2
    - comment 3

- [ ] (z) 
  - [ ] (1) 
    - comment 1
      - comment 1.a
  - [ ] (2) 
    comment 1
    - comment 2
  - [ ] (3) 
  - [ ] (4) 
  - [ ] (5) 
    - comment 1
<!-- { sort-end } -->

Resulting List

<!-- { sort-start -r } -->
 
  - [x] (1)
  - [x] (2) 
    - review [open tasks](searches\open-tasks.code-search)
  - [x] (3) 
  - [x] (4) 
    - [x] 1) 
    - [x] 2) 
    - [x] 3) 
      - comment 1
      - comment 2
      - comment 3
    - [x] 4) 
    - [x] 5) 
      - comment 1
        - comment 1.a
  
- [x] (a0) 
  - comment 1 
    - comment 1.a
    - comment 2
    - comment 3

- [ ] (a1) 
  - [ ] (1) 
    - comment 1
      - comment 1.a
  - [ ] (2) 
    - comment 2
    comment 1
  - [ ] (3) 
  - [ ] (4) 
  - [ ] (5) 
    - comment 1
- [ ] (z) 
<!-- { sort-end } -->

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.