lsp-sourcekit
lsp-sourcekit copied to clipboard
Lagging interface with company-mode
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:
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.
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?
For me it happens in Login/Login.swift in https://github.com/jandamm/gitlab-ci-viewer/tree/test.
I'll run company-diag later 👍
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, 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.
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 :)
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