Swift Emacs autocomplete
Need help with company-sourcekit?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
nathankot

Description

Completion for Swift projects via SourceKit with the help of SourceKitten

201 Stars 15 Forks 102 Commits 14 Opened issues

Services available

Need anything else?

company-sourcekit

Melpa Status

company-mode completion for Swift projects via SourceKit with the help of SourceKittenDaemon.

Limitations

  • Only works when there is a
    *.xcodeproj
    up the directory tree.
  • OSX-only, since this communicates with SourceKit which only runs on OSX (AFAIK)
  • You need to have
    curl
    on your machine

Installation

First install SourceKittenDaemon. Make sure that it's in the

exec-path
of your Emacs.

And then you can install

company-sourcekit
in the following ways:

MELPA

M-x package-install  company-sourcekit 

Source

Make sure this repository is in your

load-path
, and then:
(require 'company-sourcekit)
(add-to-list 'company-backends 'company-sourcekit)

Configuration

  • company-sourcekit-use-yasnippet
    - Use yasnippet for completion expansion. By default this is enabled if yasnippet is detected.
  • company-sourcekit-verbose
    - Log company-related messages to
    *messages*
    with verbosity
  • sourcekit-available-ports
    - A list of ports that
    sourcekittendaemon
    is allowed to listen on.
  • sourcekit-sourcekittendaemon-executable
    - Location of the
    sourcekittendaemon
    executable
  • sourcekit-curl-executable
    - Location of the
    curl
    executable
  • sourcekit-verbose
    - Log sourcekittendaemon-related messages to
    *messages*
    with verbosity

How it works

  • company-sourcekit communicates with sourcekittendaemon via HTTP.
  • Which in turn communicates with SourceKit using the sourcekitten framework.
  • sourcekittendaemon will read your
    .xcodeproj
    file and determine the best configuration options to pass to sourcekit.

Credits

Contributing

Is most welcome. Please use a feature branch and format your code with

indent-region
d(^.^)b

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.