nathankot / company-sourcekit

Completion for Swift projects via SourceKit with the help of SourceKitten

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: How to make company-sourcekit turn on automatically?

wiruzx opened this issue · comments

Company mode not being automatically enable company-sourcekitten, instead it turn on some kind of "general" mode, when it's trying to complete me based not on sourcekitten.

When I type a few chars, I got:

And only when I run company-sourcekit, the real completion is showing up:

Could you please point me at what I am doing wrong?

Can you try adding this to your init.el or executing it in the *scratch* buffer:

(add-hook 'swift-mode-hook (lambda ()
                          (set (make-local-variable 'company-backends) '(company-sourcekit))
                          (company-mode)))

And then re-load swift-mode / company-mode and see if that works?

@terhechte Yes! Thanks a lot!

I will add this step to the installation section :)