/intellij-randomness

IntelliJ plugin for inserting random numbers, strings, and UUIDs

Primary LanguageKotlinMIT LicenseMIT


Randomness

Release Documentation
Travis build status Line coverage

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

Animated sample usage of Randomness.

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:

    1. Integers, such as 7,826,922, in any base from binary to hexatrigesimal.
    2. Decimals, such as 8,816,573.10, using customisable separators.
    3. Strings, such as "PaQDQqSBEH", with custom symbol lists.
    4. Words, such as "Bridge", with custom word lists.
    5. 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].

  • โš™ 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.

    Dictionary settings

๐Ÿ’ป 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!