ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Groovy Imports

by carwinz ST2

A Sublime Text 2 plugin for inserting import statements into groovy code

Labels groovy, grails

Details

Installs

  • Total 559
  • Win 263
  • Mac 194
  • Linux 102
Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

A Sublime Text 2 plugin for inserting import statements into groovy code

No setup is required. The plugin finds possible imports:

  • By looking through other classes in the same project
  • By looking at imports in other classes in the same project
  • It is unaware of imports in libraries or the jdk, but you can make the plugin aware of common ones by adding a custom import (see: Tools > Groovy Imports > Edit custom imports)

Most people don't want their imports re-organized automatically, so the plugin attempts to insert new imports near similar ones. (But there is some scope for improvement here).

How to install

With Package Control:

  1. Run “Package Control: Install Package” command, find and install the “Groovy Imports” plugin.

Manually:

  1. Clone the git repo (https://github.com/carwinz/groovy-sublime-imports) into your packages folder (in ST, Preferences > Browse Packages… menu item to open this folder)

Usage

By default, imports will be automatically added when groovy files are saved, however you can turn this off in the config.

The default shortcut is Ctrl+Shift+Alt+i. Or use Go to Tools > Groovy Imports > Add imports

Future Development

  • The order that the imports are added needs some more tweaking
  • Support for wildcard imports (e.g. “some.package.*”)
  • If multiple options exist, pop up a dialog to select one
  • If a classname is used in a string, don't import it