terhechte/SourceKittenDaemon

Does this work with Spacemacs ?

Closed this issue · 5 comments

plm75 commented

I have sourceKitten installed and working.
I have sourceKittenDaemon installed and working.

I have dotspacemacs-additional-packages '(company-sourcekit) in the layers section of my .spacemacs
I have (add-to-list 'company-backends 'company-sourcekit) in the user-config section of .spacemacs

When I open a swift file inside a project, company-mode is enabled, but I do not get auto-completion.
However, I get messages like this printed out below the mode-line when I type some code in the file: Wrote /var/folders/nb/0zpznrt...../T/sourcekitten15197grb and when I cat that file, I get a copy of the file I'm currently editing.

Did I miss some configuration or is this just not working with spacemacs ?

@plm75 most likely unrelated to the using of spacemacs, I assume you have company-mode installed, whats the output of the *sourcekit-output* buffer?

plm75 commented

@nathankot : I have a empty array ?

Hmm so the issue is that sourcekit isn't able to find any completions for you, couple of questions:

plm75 commented

@nathankot
Thanks for you help.

  • Yes I'm working inside an Xcode project
  • Yes, you are right, I was using a workspace
  • Xcode 7.3.1, Build 7D1014

re second point: after creating a new blank test project in Xcode and opening a swift file (AppDelegate), the source kit-output buffer does not exist. If I start typing, nothing happens.

I need to execute: company-sourcekit to kick-start it: a sourcekit-output buffer is created and populated with what appears to be completion tokens. In my AppDelegate file, no completions show up automatically, I need to execute :company-sourcekit to have completion suggestions.

For example:

  • If I type: self. nothing appears automatically. I need to do ESC :company-sourcekit for completion list to show up.

Looks like it may be it more a company-mode configuration problem on my side rather than an issue with source kitten ? Sorry if this is the case.

Just in case, if there are any spacemacs users out there that successfully configured auto-completion with source-kitten, my .spacemacs file contains:
dotspacemacs-additional-packages '(company-sourcekit vimish-fold evil-vimish-fold)

and
`(defun dotspacemacs/user-config ()

(add-hook 'evil-insert-state-exit-hook 'delete-trailing-whitespace)
(add-hook 'hack-local-variables-hook (lambda () (setq truncate-lines t)))

(global-company-mode)

(evil-vimish-fold-mode 1)
(display-time-mode 1)

(add-to-list 'company-backends 'company-sourcekit)

(global-set-key (kbd "C-j") 'evil-window-down)
(global-set-key (kbd "C-k") 'evil-window-up)
(global-set-key (kbd "C-h") 'evil-window-left)
(global-set-key (kbd "C-l") 'evil-window-right)

(spacemacs/set-leader-keys "W" 'evil-write-all)

(global-set-key [wheel-right] 'scroll-left)
(global-set-key [wheel-left] 'scroll-right))`

@plm75 no problem :)
Yup the problems you described above seem related to company configuration.
Closing this issue now, feel free to re-open if you run into it again!