emacs-lsp / lsp-sourcekit

lsp-mode :heart: Apple's sourcekit
https://emacs-lsp.github.io/lsp-sourcekit
GNU General Public License v3.0
102 stars 12 forks source link

Lagging interface with company-mode #6

Open jandamm opened 4 years ago

jandamm commented 4 years ago

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.

danielmartin commented 4 years ago

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?

jandamm commented 4 years ago

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 commented 4 years ago
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
danielmartin commented 3 years ago

@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.

jandamm commented 3 years ago

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 :)

blandinw commented 3 years ago

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