lsp-sourcekit icon indicating copy to clipboard operation
lsp-sourcekit copied to clipboard

Lagging interface with company-mode

Open jandamm opened this issue 5 years ago • 6 comments

I'm using lsp-sourcekit with company-mode as part of an Doom Emacs configuration.

When I start typing and company wants to present auto completion, the interface freezes for about a second. Then I'm presented with an extremely long list of auto completion possibilities:

Screen Shot 2019-11-10 at 21 52 48

This only happens when I start typing. There is no issue, when I've got the type written out and just look for members of the type. Abc. is working fine and presents the init, Type and self.

jandamm avatar Nov 10 '19 21:11 jandamm

Thanks for the report. Do you have a sample project where this behavior is reproducible? Can you post the output of running M-x company-diag?

danielmartin avatar Nov 11 '19 08:11 danielmartin

For me it happens in Login/Login.swift in https://github.com/jandamm/gitlab-ci-viewer/tree/test.

I'll run company-diag later 👍

jandamm avatar Nov 11 '19 08:11 jandamm

Emacs 26.3 (x86_64-apple-darwin18.7.0) of 2019-09-05 on Mac
Company 0.9.10

company-backends: (company-lsp company-yasnippet)

Used backend: company-lsp
Major mode: swift-mode
Prefix: stop
Completions: none

jandamm avatar Nov 11 '19 13:11 jandamm

@jandamm, SourceKit-LSP has just implemented server-side filtering of completion results (see https://github.com/apple/sourcekit-lsp/pull/298). This should improve performance, specially on Emacs <27, where JSON serialisation is done in Emacs Lisp code.

Could you compile a SourceKit-LSP toolchain from top of tree and see if completion performance is better? Thanks.

danielmartin avatar Jul 29 '20 21:07 danielmartin

Hey @danielmartin, thanks for the follow up. I've switched back to Neovim in the meantime. Having some performance issues with sourcekit-lsp there as well. But they improved over the last months, so I'd guess company mode has gotten better as well :)

jandamm avatar Jul 29 '20 22:07 jandamm

For posterity, building sourcekit-lsp removed the lag for me.

git clone https://github.com/apple/sourcekit-lsp.git
cd sourcekit-lsp
export TOOLCHAINS=swift
swift package update
swift build -c release
ls -l .build/release/sourcekit-lsp

blandinw avatar Nov 08 '20 11:11 blandinw