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
merged 1 commit into from Oct 16, 2019

Conversation

@Krystofee
Copy link
Contributor

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.

@msftclas

This comment has been minimized.

Copy link

msftclas commented Oct 14, 2019

CLA assistant check
All CLA requirements met.

Copy link
Member

jrieken left a comment

lgtm

@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
Details
license/cla All CLA requirements met.
Details
@NotWearingPants

This comment has been minimized.

Copy link
Contributor

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.

@jrieken

This comment has been minimized.

Copy link
Member

jrieken commented Oct 17, 2019

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

@seognil

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
Projects
None yet
5 participants
You can’t perform that action at this time.