Randomness
Rather than going to random.org or making up your own random data, you can now insert random numbers, strings, and UUIDs using an IntelliJ action!
This plugin is also available on the plugin repository.
๐ How to use
To insert random data, press Alt + R (โฅR) and choose the type of data you want to insert. A different value will be 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 whole array of values.
- Settings: Hold Ctrl to open the settings of that data type.
- Repeat: Hold Alt (โฅ) to insert the same value at each caret.
You can also hold multiple modifier keys to combine their effects.
Randomness can also be found in the main menu under Tools or in Code > Generate.
โจ Features
-
๐ธ Data Types
There are five types of data that can be inserted:- Integers, such as
7,826,922
, in any base from binary to hexatrigesimal. - Decimals, such as
8,816,573.10
, using customisable separators. - Strings, such as
"PaQDQqSBEH"
, with custom symbol lists. - Words, such as
"Bridge"
, with custom word lists. - UUIDs, such as
0caa7b28-fe58-4ba6-a25a-9e5beaaf8f4b
, with or without dashes.
In addition to these data types, it's also possible to generate entire arrays of a data type. For example, an array of integers might look like
[978, 881, 118, 286, 288]
. - Integers, such as
-
โ Settings
The way the data is generated can be adjusted to your demands. You can customise the smallest integer to generate, the quotation marks to surround strings with, the number of elements to put in an array, the decimal separator to use, the capitalisation of strings and UUIDs, and much more. -
๐ Previews
To help you decide what settings to choose, a preview of the data that is generated with your current settings is shown at the bottom of the settings window. -
๐จ Shortcuts
Instead of using up all your shortcuts, Randomness only uses the Alt + R (or โฅR) shortcut by default. However, you have the option to assign a unique shortcut to each individual data type and each settings window to streamline your workflow. -
๐ฌ Symbol sets
While Randomness comes with a varied selection of symbols to use for generating strings, it also gives you the option to add your own symbols, with support for Chinese symbols and emoji. -
๐ Dictionaries
Randomness is bundled with a small English dictionary from which it chooses random words. However, you may want to add random words from another language or insert random movie quotes. You can create your own dictionaries by creating a text file and putting one option on each line, and saving the file with the.dic
extension. Empty lines and lines that start with a#
are ignored.
๐ป Development
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.
๐จ Build/run
$ gradlew runIde # Open a sandbox IntelliJ instance running the plugin
$ gradlew buildPlugin # Build an installable zip of the plugin
๐งช Quality assurance
$ gradlew test # Run tests
$ gradlew test --tests X # Run tests in class X
$ gradlew check # Run tests and static analysis
$ gradlew codeCoverageReport # Run tests and calculate coverage
$ gradlew runPluginVerifier # Check for compatibility issues
๐ Documentation
$ gradlew dokka # Generate documentation
๐ผ Icons
The icons used by the plugin are found in the .sketch file. You can open this file with Sketch (macOS), Lunacy (Windows), or Figma (Linux).
๐ Credits
Thanks to Georgios Andreadis for the
original logo!
Thanks to Meilina Reksoprodjo for help with macOS user testing!