Git Product home page Git Product logo

intellij-postfix's Introduction

IntelliJ IDEA Postfix Completion plugin

The basic idea is to prevent caret jumps backward while typing code, let you start with the some expression, explore some APIs, think about what you are going to do and after finish with statement of some type.

Examples

options

See more examples.

Current state

This plugin became a core part of IntelliJ IDEA 13.1 experience! Source code is no longer maintained here.

Download

Latest builds for IDEA 13 is available for download in IntelliJ IDEA plugin repository. To install into IDEA simply go PreferencesPluginsBrowse repositories... and search for "postfix".

Features

Available templates:

  • .if – checks boolean expression to be true if (expr)
  • .else – checks boolean expression to be false if (!expr)
  • .var – initialize new variable with expression T name = expr;
  • .null – checks nullable expression to be null if (expr == null)
  • .notnull – checks expression to be non-null if (expr != null)
  • .instanceof – checks type expr instanceof T ? ((T) expr).m : null
  • .not – negates value of inner boolean expression !expr
  • .for – iterates over collection for (T item : collection)
  • .while – uses expression as loop condition while (expr)
  • .arg – helps surround argument with invocation method(expr)
  • .cast – surrounds expression with cast (SomeType) expr
  • .new – produces instantiation expression for type new T()
  • .fori – surrounds with loop for (int i = 0; i < expr.length; i++)
  • .forr – reverse loop for (int i = expr.length - 1; i >= 0; i--)
  • .field – introduces field for expression _field = expr;
  • .par – surrounds outer expression with parentheses (expr)
  • .return – returns value from containing method return expr;
  • .switch – switch over integral/enum/string values switch (expr)
  • .throw – throws exception of 'Throwable' type throw new Exception();
  • .assert - creates assertion from boolean expression assert expr;
  • .synchronized – produces synchronized block synchronized (expr)

Other features:

  • Template expansion by Tab key in editor (like live templates)
  • Settings page to disable/enable particular postfix templates

.NET version

intellij-postfix's People

Contributors

controlflow avatar ignatov avatar zolotov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intellij-postfix's Issues

Auto braces insertion

Now braces insertion in .if, .else, .null and .notnull, any plan for other postfix actions? such as 10.fori , list. synchronized etc.

Editable code template

Live Templates are editable on IDE and Postfix Completions are not. It would be much better if we can edit them too.

No avaiability of NewExpressionPostfixTemplate in IntelliJ 16 / AS 2.2

Hi!

I am wondering why most of the postfix completions except the NewExpressionPostfixTemplate are available in the latest release of IntelliJ. I'm working in some templates right now, and I wanted to include the NewExpressionPostfix one. I think is so useful, we are always creating instances of objects. Any specific reason?

Enable custom postfix templates

First of all, I like your plugin very much. It really speeds up development time in verbose languages like Java and I like the object oriented approach, which has several advantages over the classical live templates.

In the last years I worked a lot with Scala. Whenever I have to work with Java I miss dozens of nice methods Scala provides on basic and collection types, such as:

  • string.toInt
  • array.toList
  • list.toSet

I would really like to have those functions (or postfix templates) in Java as well. But I assume the they might blow up this project.

What do you think about enabling custom postfix templates which can be created by the user?

According to http://stackoverflow.com/questions/29248188/is-there-a-way-to-create-custom-postfix-completions-in-intellij it seems that I'm not the only one who is looking for them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.