Skip to content

This plugin enables you to open the built-in Intellij-IDEA diff-viewer to compare validation- and output-files in the current project or module using a configurable keyboard shortcut.

License

Notifications You must be signed in to change notification settings

cronn/validation-files-comparison-intellij-plugin

Repository files navigation

CI JetBrains Plugin Apache 2.0 Valid Gradle Wrapper

Validation-File Comparison

IntelliJ plugin as extension to cronn's validation file assertion library.
Compare and accept output and validation files without context switches.
Further features:

  • Rename related validation files when methods or classes are renamed
  • Jump to related validation file from code and vice-versa

Installation

Go to File/IntelliJ IDEA | Settings | Plugins, search in tab Marketplace for Validation-File Comparison and click on install.

Usage

Open Validation-File Comparison

Execute tests which use validation files, open the test itself or open the production code for it and run the the action Validation-File Comparison.

You can find the action using ...

  • IntelliJ's Find Action (Ctrl+Shift+A / ⇧⌘A) and search for Validation File Comparison
  • View | Validation-File Comparison
  • Right Click | Validation-File Comparison
  • Or the default shortcut Alt+Shift+V /⌥⇧V

This plugin finds the corresponding (sub-)module for the current dialog and compares the two directories [SUBMODULE-PATH]/data/test/validation and [SUBMODULE-PATH]/data/test/output, which are the default directories for validation file assertion library.

Rename Tests with Validation Files

When renaming a test with validation files the validation and output files will be suggested for renaming as well. Simply use the rename refactoring of intellij (Shift+F6 / ⇧F6) and apply the suggested renaming as wished. To disable this feature simply trigger the keybinding for the renaming twice and deselect "Rename validation and output files".

Jump to Validation File or Code

Similar to IntelliJ's build-in action for switching between tests and implementations, it is possible to directly jump into the according validation file from a test and back. Simply press the default shortcut Alt+Shift+F /⌥⇧F and the according file is opened at the relevant position. If there are multiple possible targets, a selection window with all targets is presented. This action can be used from within a test method as well as for the whole test class. When used from a validation file, it finds the deepest possible code target to jump to, also regarding nested test classes and methods with multiple validation files.

Configuration

As for every IntelliJ action, you can configure your own shortcut for the Validation-File Comparison action. Simply go to File/IntelliJ IDEA | Settings | Keymap , search for Validation-File Comparison and configure a new shortcut.

The behavior of the action can be configured in the dedicated settings dialog under File/IntelliJ IDEA | Settings | Tools | Validation-File Comparison Plugin.

Development

Getting Started

TLDR

Build project
./gradlew build
Start IntelliJ instance with plugin installed
./gradlew runIde
Test plugin for compatibility issues
./gradlew runPluginVerifier

Updating the Readme / plugin.xml

If new readme sections regarding the usage of the plugin are added or existing ones are updated, make sure to also adjust the <description> in the plugin.xml. Ideally generate html content from this markdown file to ensure equal content (e.g. https://markdowntohtml.com/).

Publishing

Publishing is done using the publishPlugin gradle task (using a valid access token) as described in the documentation.

./gradlew publishPlugin -Dorg.gradle.project.intellijPublishToken="<YOUR_TOKEN>"

About

This plugin enables you to open the built-in Intellij-IDEA diff-viewer to compare validation- and output-files in the current project or module using a configurable keyboard shortcut.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages