• This repository has been archived on 15/Dec/2020
  • Stars
    star
    322
  • Rank 130,398 (Top 3 %)
  • Language
    Java
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Intellij/Android Studio plugin to help visualise side effects in your code.

Deprecated

This project is no longer maintained. No new issues or pull requests will be accepted. You can still use the source or fork the project to suit your needs.

Here Be Dragons

Here be dragons is an Intellij/Android Studio plugin that let's you annotate your impure Java methods with the @SideEffect annotation and shows a little dragon icon in the gutter when you call them.

How the plugin works

Why would I want to do this?

When writing functional style code, isolating impure and pure functions becomes very important. This helps you visually identify which methods are impure when a bunch of methods are being called in a code block.

For a beginner friendly introduction to functional programming in Android, please checkout out my blog series.

Installation

Install the plugin

Download the plugin jar and select "Install Plugin From Disk" in IntelliJ's plugin preferences.

Add the annotation library

Add the jcenter repository to your gradle build file if it's not already present:

repositories {
    jcenter()
}

Next, add the lib containing the @SideEffect annotation as a dependency:

dependencies {
    compile 'com.anupcowkur:here-be-dragons-annotation:1.0.1'
}

Usage

Simpy add the @SideEffect annotation to any method you want like this:

import com.anupcowkur.herebedragons.SideEffect;

public class Test {
    @SideEffect
    public void foo() {
        // do some impure things
    }
}

And when you call the method anywhere, you'll see the dragon icon show up in the IDE gutter.

License

This project is licensed under the MIT License