Skip to content

Added order to snippet tab stops - #7925

Merged
Alexandru Dima (alexdima) merged 1 commit into
microsoft:masterfrom
csvn:master
Jun 28, 2016
Merged

Alexandru Dima (alexdima) merged 1 commit into
microsoft:masterfrom
csvn:master

Conversation

@csvn

Copy link
Copy Markdown
Contributor

Currently when tabbing through snippets you get the order each tab-stop/id is parsed. I've tried to improve on this with the following criterias:

  • Id's are sorted first with their relative order unchanged (e.g. {id}, {id:label})
  • Tab-stops follow id's, and are sorted in ascending order (e.g. "$2 $3 $1" => $1, $2, $3)
  • The $0 (or highest tab-stop) will be used as the final placeHolder

I've added a few tests and tested this with various snippets and I think it feels much better. You can now do import snippets in the correct order for IntelliSense!

import { $2 } from '${1:module}';$0

'$3 $2 $1' will occur in the order $1, $2, $3.
@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified Erich Gamma (@egamma) and alexandrudima to be potential reviewers

@msftclas

Hi Christian Svensson (@csvn), 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

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

Thanks, MSBOT;

@alexdima

Copy link
Copy Markdown
Member

Truly nice! Thank you! ❤️

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.

5 participants