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

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
Copy link

msftclas commented Oct 14, 2019

CLA assistant check
All CLA requirements met.

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jrieken jrieken added this to the October 2019 milestone Oct 16, 2019
@jrieken jrieken merged commit 6b0613a into microsoft:master Oct 16, 2019
@NotWearingPants
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
Copy link
Member

jrieken commented Oct 17, 2019

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

@seognil
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~

@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.

[Feature Request] snippet support RANDOM
5 participants