spacemacs/layers/+tools/ycmd
syl20bnr 1c4f685b13 core: refactor layer system
TL;DR Should get 20~25% speed improvement on startup, should get a big
improvement when using ivy or helm SPC h SPC. Users with layers.el files
in their layers must use `configuration-layer/declare-used-layer`
instead of `configuration-layer/declare-layer`

The implementation of the layer system made heavy use of `object-assoc`
and `object-assoc-list` functions which are not efficient. This PR
mainly replaces those object lists with hash maps in order to index the
objects by their name and achieve an O(1) access time.

The old object lists `configuration-layer--layers` and
`configuration-layer--packages` have been each by two variables each:
- `configuration-layer--indexed-layers` which is a hash-map of all the
layer objects and `configuration-layer--used-layers` which is a list of
all _used_ layers symbols,
- symmetrically `configuration-layer--indexed-packages` which is a
hash-map of all the package objects and
`configuration-layer--used-packages` which is a list of all _used_
packages symbols.

The hash map `configuration-layer--layer-paths` is gone, now we create
directly layer objects when discovering the layers and set the :dir
property. Note that previously the layer paths were the parent directory
of the layer, now :dir is the layer path.

The function `configuration-layer//make-layer` is now similar to its
counterpart `configuration-layer//make-package` in the sense that it
takes an optional `obj` to be able to override its properties.

The functions `configuration-layer/declare-layer` and
`configuration-layer/declare-layers` now takes an optional parameter
`usedp` in order to declare used or not used layers. For convenience
new functions have been added: `configuration-layer/declare-used-layer`
and `configuration-layer/declare-used-layers`, users _must_ update all
occurrences of `configuration-layer/declare-layer` by
`configuration-layer/declare-used-layers` in their `layers.el` files.

`helm-spacemacs-help` and `ivy-spacemacs-help` are updated to match the
changes in `core-configuration-layer.el`.

Rename some variables to make them more explicit:
`configuration-layer-no-layer` -> `configuration-layer-exclude-all-layers`
`configuration-layer-distribution` -> `configuration-layer-force-distribution`
2016-07-28 23:26:54 -04:00
..
global_conf.py Use + instead of ! for layer categories 2015-09-11 00:13:51 -04:00
packages.el core: refactor layer system 2016-07-28 23:26:54 -04:00
README.org Provide more details for ycmd installation and configuration 2016-06-12 21:49:07 -04:00

YCMD layer

Description

This layer adds emacs-ycmd support.

Install

Layer

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

YCMD

  1. Install the ycm server. Installation instructions can be found here.
  2. Set the ycmd-server-command variable to reflect the path to the installation:

    (setq ycmd-server-command '("python" "/path/to/YouCompleteMe/third_party/ycmd/ycmd"))
  3. Instead of .clang_complete ycmd uses a .ycm_extra_conf.py file.
  4. Whitelist the file by adding the following to .spacemacs:

    ;; In this example we whitelist everything in the Develop folder
    (setq ycmd-extra-conf-whitelist '("~/Develop/*"))
  5. The completion is not going to work automatically until we actually force it:

    (setq ycmd-force-semantic-completion t)

Other Requirements

This package requires the auto-completion layer in order to get actual completion. The syntax-checking layer is required for flycheck support.

Configuration

By default this layer only activates ycmd for c++-mode.

If you want ycmd support in other modes you might just want to add it for specific languages like:

(add-hook 'c++-mode-hook 'ycmd-mode)

Key Bindings

Adds SPC m g g go to definition binding to c++-mode as well as SPC m g G for the more imprecise but faster version.