Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RANDOM, RANDOM_HEX snippet variables #82529

merged 1 commit into from Oct 16, 2019


Copy link

Krystofee commented Oct 14, 2019

This PR fixes #80297

I've take the issue since there was no activity. I will be happy to write tests, when I'll get approve for this functionality.

Ping @jrieken.


This comment has been minimized.

Copy link

msftclas commented Oct 14, 2019

CLA assistant check
All CLA requirements met.

Copy link

jrieken left a comment


@jrieken jrieken added this to the October 2019 milestone Oct 16, 2019
@jrieken jrieken merged commit 6b0613a into microsoft:master Oct 16, 2019
2 checks passed
2 checks passed
VS Code #20191014.62 succeeded
license/cla All CLA requirements met.

This comment has been minimized.

Copy link

NotWearingPants commented Oct 17, 2019

Why is this specifically 6 random characters?
This is very arbitrary and the use cases for exactly 6-digit random decimal or hex numbers other than a hex color are non-existent.

This should be removed @jrieken.


This comment has been minimized.

Copy link

jrieken commented Oct 17, 2019

So, what is your suggestion then? Just remove? 5 numbers? 3?


This comment has been minimized.

Copy link

seognil commented Oct 21, 2019

Wow, thanks for the work
the origin request is from me

I agree with NotWearingPants
the approach is not flexible
but it's enough for my original proposal already

I thought that maybe the 'snippet system' could support inbuilt function rather than const only
or as what I imaged before: parse any custom valid JS statements, so that vscode itself would keep simple

the first case is like `color: #${RANDOM(6, hex)}` or `console.warn('tag-${RANDOM(8, 36)}')`
the customable way is like `console.warn(${Math.random().blahblah()})`

Anyway, thanks for the work~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.