Skip to content

Adds sort lines (ascending and descending) command - #2796

Merged
Alexandru Dima (alexdima) merged 2 commits into
microsoft:masterfrom
martellaj:joem/sort-lines
Mar 17, 2016
Merged

Alexandru Dima (alexdima) merged 2 commits into
microsoft:masterfrom
martellaj:joem/sort-lines

Conversation

@martellaj

Copy link
Copy Markdown
Member
  • Took a crack at issue Add "sort lines" option #536, given it had the help wanted label
  • Adds keyboard shortcuts to sort lines (chose arbitrary shortcuts, probably want to change those)
  • Didn't create formal test cases (won't have the time for a while), but did verify changes using strings from random.org

@msftclas

Hi Joe Martella (@martellaj), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@msftclas

Joe Martella (@martellaj), Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSBOT;

@csholmq

Copy link
Copy Markdown

Nice job. Question is; should this be merged or handled by an extension? E.g. Sort lines

@martellaj

Copy link
Copy Markdown
Member Author

I know Sublime Text has this functionality built in and that it's often a requested feature for IDEs. I don't see a downside of including it without having to download a third party extension, given that it's an operation on code lines with essentially no logic (I'm on the OneDrive team and would love to alphabetize our dependencies. 😋).

Really I was just trying to contribute where I could to a product I love using. Would love to see it merged!

@alexdima Alexandru Dima (alexdima) added this to the March 2016 milestone Mar 16, 2016
@Tyriar

Copy link
Copy Markdown
Contributor

Commenting so I get a participating notification. I want to deprecate my extension if it gets in :)

@alexdima
Alexandru Dima (alexdima) merged commit 60caccd into microsoft:master Mar 17, 2016
Alexandru Dima (alexdima) added a commit that referenced this pull request Mar 17, 2016
Adds sort lines (ascending and descending) command
@alexdima

Copy link
Copy Markdown
Member

Joe Martella (@martellaj)

Thank you! 👍

I took the liberty to tweak the keybindings and add some tests while merging.

@martellaj

Copy link
Copy Markdown
Member Author

Sweet! Happy to contribute. ☺️ Keep rocking, guys!

@martellaj
Joe Martella (martellaj) deleted the joem/sort-lines branch March 22, 2016 13:28
@rafareino

Copy link
Copy Markdown

It took me a few minutes to me to understand how this works.

To me at least, do not seems particularly obvious that I must select the lines before sorting out, what if it acts like Copy/Paste with no selection (defaults to whole line) the command should either alert if there isn't any selection to act upon, or act over the whole file instead.

@dtromans

Copy link
Copy Markdown

Can someone please provide a link to the documentation for this feature? I can't find this feature in any of the menus.

@martellaj

Copy link
Copy Markdown
Member Author

Interesting. Seems it's no longer showing up in the command palette, but does show up as keyboard shortcuts.

@dtromans

Copy link
Copy Markdown

Joe Martella (@martellaj) Ahh, thank you. I do see it in the command palette if I type "sort". I was expecting to access the feature from one of the Edit/Selection/context menus.

@martellaj

Copy link
Copy Markdown
Member Author

Yep, I'm seeing it in the command palette now, too. Pretty sure it was absent on the Insider build I was on 2 days ago though. Regardless, all good now. 👍

@OlafvdSpek

Copy link
Copy Markdown

How does one access this feature?

Typing sort doesn't return anything.

@martellaj

Copy link
Copy Markdown
Member Author

Olaf van der Spek (@OlafvdSpek) You're sure you're in the command palette, right? I still see it FWIW.

image

@OlafvdSpek

Copy link
Copy Markdown

No, I was trying the Ctrl-P one.. sorry.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants