Rather than going to random.org or making up your own random data, you can now insert random numbers, UUIDs, names, IP addresses, and much more using an IntelliJ action!
This plugin is also available on the plugin repository!
To insert random data, press Alt + R (or โฅR) to open the list of available templates and choose one that suits your task. By default, a different value is inserted at each caret.
You can modify this behavior by holding a key while selecting the type of data to insert:
- Array: Hold Shift to insert a customisable array of values.
- Repeat: Hold Alt (or โฅ) to insert the same value at each caret.
- Settings: Hold Ctrl to open the settings of that data type.
You can hold multiple modifier keys to combine their effects.
Randomness can also be found in the main menu under Tools or in Code > Generate.
-
๐ธ Data Types
There are six basic data types that can be inserted and customised:- Integers, such as
7,826,922
, from a custom range, in any base from binary to hexatrigesimal. - Decimals, such as
8,816,573.10
, using customisable separators. - Strings, such as
"PaQDQqSBEH"
, with support for reverse regex. - Words, such as
"Bridge"
, with predefined or custom word lists. - UUIDs, such as
0caa7b28-fe58-4ba6-a25a-9e5beaaf8f4b
, with or without dashes. - Date-times, such as
2022-02-03 19:03
, or any other format you want.
- Integers, such as
-
๐งฌ Templates
For complex kinds of data, you can use templates. A template is a list of data types that should be concatenated to create random data. Insert phone numbers, email addresses, URLs, IP addresses, or any custom data type you can think of. Of course, Randomness comes bundled with a whole array of predefined templates to help you out. If needed, you can reuse a template by including it in another template using a reference. -
๐๏ธ Arrays
Need a lot of data? Insert an entire array of any template you want. For example, an array of integers might look like[978, 881, 118, 286, 288]
. You can customise the brackets, delimiter, and number of elements to your liking every time you insert an array, because no two arrays are the same. -
โจ๏ธ Shortcuts
Instead of using up all your shortcuts, Randomness only uses the Alt + R (or โฅR) shortcut by default. However, to streamline your workflow, you can assign shortcuts to any template under your IDE's Keymap settings. -
๐จ Fast insertion
The insertion popup (shown when you press Alt + R (or โฅR) by default) is searchable: Just type something in the popup and relevant templates will be filtered out. Or use the hotkeys that are assigned to the first 10 templates in the list: Press any digit to directly insert the corresponding template. Reorder templates in the settings menu to change which template uses which hotkey. -
๐ Previews
To help you decide what settings to choose, a preview of the template is shown while you're editing.
This section contains instructions in case you want to build the plugin from source or want to help with development. Please also check the contribution guidelines.
$ gradlew runIde # Open a sandbox IntelliJ instance running the plugin
$ gradlew buildPlugin # Build an installable zip of the plugin
$ gradlew buildPlugin -Pbuild.hotswap # Same as above, but allow hot-swapping the plugin during development
$ gradlew signPlugin # Sign built plugin
Signing the plugin requires specific environment variables to be set to refer to appropriate key files. See Plugin Signing for more information.
$ gradlew test # Run tests (and collect coverage)
$ gradlew test --tests X # Run tests in class X (package name optional)
$ gradlew test -Pkotest.tags="X" # Run tests matching tag(s) X (also supports not (!), and (&), or (|))
$ gradlew koverHtmlReport # Create HTML coverage report for previous test run
$ gradlew check # Run tests and static analysis
$ gradlew runPluginVerifier # Check for compatibility issues
Kotest tests can be tagged to allow selectively running tests.
The tags for Randomness are statically defined in
Tags
.
Tag an entire test class by adding tags(...)
to the class definition, or tag an individual test context
by
writing context("foo").config(tags = setOf(...)) {
.
It is not possible to tag an individual test
due to limitations in Kotest.
To run only one context
in some test class X
, prefix the context
's name with f:
and run with --tests X
.
The prefix f:
filters out other context
s in that test class, and --tests X
filters out other test classes.
Alternatively, tag the desired context
with the Focus
tag and run with -Pkotest.tags="Focus"
to filter by that
tag.
$ gradlew dokkaHtml # Generate documentation
The icons used by the plugin are found in the file icons.sketch
.
You can open this file with Sketch (macOS), Lunacy (Windows), or
Figma (Linux).
I want to thank everyone who contributed something to Randomness, no matter the size of that contribution.
In chronological order of contribution:
- Thanks to Casper Boone for reporting a bug and for suggesting emoji support!
- Thanks to Victor Tyazhelnikov for suggesting the array data type!
- Thanks to Georgios Andreadis for the original logo!
- Thanks to Oleksii for suggesting the UUID data type and for suggesting the hex symbol set!
- Thanks to Meilina Reksoprodjo for help with macOS user testing!
- Thanks to Wouter van Vliet for helping me clarify the "repeat" action!
- Thanks to Paweล Lipski for reporting two bugs in the verification script!
- Thanks to opticyclic for suggesting two improvements to the verification script!
- Thanks to Niraj Jadhav for reporting a bug and demonstrating that the error reporter works!
- Thanks to jrborases for suggesting a configurable popup!
- Thanks to Alex Pernot for participating in the data type discussion!
- Thanks to solo for his contributions to the data type discussion in several places, suggesting the removal of the integer range limit, and suggesting the byte preset!
- Thanks to Martin Kaspar van Laak for reporting that symbol sets didn't get saved!
- Thanks to Aleksey Bobyr for reporting a critical UI bug in WebStorm EAP!
- Thanks to Lukas for helping me find a bug in IntelliJ!
- Thanks to Pascal for reporting a bug with custom shortcuts!
- Thanks to Rishi Maharaj for suggesting to add prefix and postfix options to strings!
- Thanks to Christian Baune for reporting recurring issues with load corrupted settings!
- Thanks to Vladislav Rassokhin for reporting an issue with slow actions during indexing!
- Thanks to Luc Everse for suggesting generating non-matching strings!
- Thanks to ForNeVeR for reporting a compatibility issue with the IntelliJ EAP!
- Thanks to Vitaly Provodin for also reporting that compatibility issue!
- Thanks to Juraj Jurฤo for suggesting adding support for newer UUID versions!
If I should add, remove, or change anything here, just open an issue or email me!