spacemacs/layers/+lang/java
Eivind Fonn 928983da47 Refactor jump to definition
This commit defines:

- spacemacs-default-jump-handlers: a list of functions that can jump to
  definition in ALL modes.

- spacemacs-jump-handlers-MODE: a list of functions that can jump to
  definition in MODE.

- spacemacs-jump-handlers: a buffer-local list of functions that can
  jump to definition. This is made up of the values of the two previous
  variables whenever a given major mode is activated.

- spacemacs/jump-to-definition: a function that tries each function in
  spacemacs-jump-handlers in order, and stops when one of them takes us
  somewhere new.

- spacemacs|define-jump-handlers: a macro that
  * defines spacemacs-jump-handlers-MODE, possibly filled with initial
    functions
  * defines a function that is added to the hook of the given MODE
  * binds “SPC m g g” of that MODE to spacemacs/jump-to-definition

This is an attempt to harmonize all the different approaches to jumping.
Specifically,

- Existing intelligent jump packages that work for only a single mode
  should go to the beginning of spacemacs-jump-handlers-MODE. E.g.
  anaconda for python, ensime for scala, etc.

- Packages like gtags that work for several modes (but potentially not
  all) and which is dumber than the intelligent jumpers should go the
  the END of spacemacs-jump-handlers-MODE.

- Packages like dumb-jump that work for all modes should go to
  spacemacs-default-jump-handlers.

In all cases the order of the jump handlers in each list should be from
most to least intelligent.

Fixes #6619
2016-08-22 15:08:25 +02:00
..
img
config.el
funcs.el
packages.el Refactor jump to definition 2016-08-22 15:08:25 +02:00
README.org Shorter lines in java/README.org 2016-08-05 21:18:32 +02:00

Java layer

/TakeV/spacemacs/media/commit/928983da4774032bf25d5acded44cdc298034372/layers/+lang/java/img/java.png

Description

This layer adds support for the Java language using the Eclim client/server.

Layer Installation

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add java to the existing dotspacemacs-configuration-layers list in this file.

Eclim

Eclim provides the ability to access Eclipse features such as code completion, searching, code validation, and many more.

Installation

For installation check the official page.

Then set the Eclipse and Eclim paths in dotspacemacs/user-config, for instance:

  (setq eclim-eclipse-dirs "~/opt/eclipse"
        eclim-executable "~/opt/eclipse/eclim")

You can also configure other options, as shown below:

  (setq
   ;; Use another eclimd executable
   eclimd-executable "/path/to/another/executable"
   ;; Specify the workspace to use by default
   eclimd-default-workspace "/path/to/default/eclipse/workspace"
   ;; Whether or not to block emacs until eclimd is ready
   eclimd-wait-for-process t)

Usage

Start the eclim daemon with SPC m d s and stop it with SPC m d k. (See below.)

Key bindings

Java-mode

Project management

Key Binding Description
SPC m p b Build project
SPC m p c Create project
SPC m p d Delete project
SPC m p g Open file in current project
SPC m p i Import project
SPC m p j Information about project
SPC m p k Close project
SPC m p o Open project
SPC m p p Open project management buffer
SPC m p u Update project

Eclimd

Key Binding Description
SPC m d s Start daemon
SPC m d k Stop daemon

Maven

Key Binding Description
SPC m m i Run maven clean install
SPC m m I Run maven install
SPC m m p Run one already goal from list
SPC m m r Run maven goals
SPC m m R Run one maven goal
SPC m m t Run maven test

Goto

Key Binding Description
M-, jump back from go to declaration/definition
SPC m g g go to declaration
SPC m g t go to type definition

Refactoring

Key Binding Description
SPC m r i optimize imports
SPC m r f Format file
SPC m r r Rename symbol

Documentation, Find

Key Binding Description
SPC m f f general find in project
SPC m h h show documentation for symbol at point
SPC m h u show usages for symbol at point

Problems

Key Binding Description
SPC m e a set all problems for next/prev action
SPC m e b open buffer with problems
SPC m e c show options with problem corrections
SPC m e e set only errors for next/prev action
SPC m e f set only current file for next/prev action
SPC m e n go to next problem
SPC m e o open buffer with problems
SPC m e p go to previous problem
SPC m e w set warnings for next/prev action

Tests

Key Binding Description
SPC m t t run JUnit tests for current method or current file or project

Problems buffer

Key Binding Description
RET go to problem place
a show all problems
e show only errors
f show problems only for current file
g refresh problems
q quit
w show only warnings

Projects buffer

Key Binding Description
RET go to current project
c go to problem place
D delete project
g refresh buffer
i info about current project
I import existing project into the workspace
m mark current project
M mark all projects
N create new project
o open project
p update project
q quit
R rename current project
u unmark current project
U unmark all projects