Closed benwoodward closed 5 years ago
You can increase timeout for completion.
Can you tell me how to do that please?
Add "suggest.timeout": 5000
to coc-settings.json
to increase.
That fixed the timeout errors, however, sourcekit-lsp
doesn't seem to be working properly. I tried rebuilding and changed my config to the following:
{
"diagnostic.checkCurrentLine": true,
"suggest.timeout": 2000,
"languageserver": {
"swift": {
"command": "/Users/ben/dev/GitHub/sourcekit-lsp/.build/x86_64-apple-macosx/debug/sourcekit-lsp",
"args": [],
"filetypes": ["swift"],
"initializationOptions": {},
"settings": {
}
}
}
}
I also think it only works on projects that have been compiled with swift build
. Think I'm gonna forget about this for now and come back when the sourcekit-lsp
is more mature.
You can checkout verbose output from language server: https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel
So I updated my lsp config with "trace.server": "verbose"
and if I view the logs with :CocCommand workspace.showOutput
I see the following error:
[Trace - 2:59:42 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "could not find manifest, or not a SwiftPM package: /Users/ben/dev/swift/test"
}
Looks like sourcekit-lsp
doesn't work with XCode projects, because there is currently no way for it to understand XCode project files.
I have:
downloaded the XCode 11 beta (Version 11.0 beta 2 (11M337n))
Installed Swift v5.1 dev snapshot using
swiftenv
:Downloaded and built
sourcekit-lsp
:set 'command line tools' version to xcode 11 in XCode > prefs > locations
Added the following to
coc-settings.json
via:CocConfig
Things seem to work, but they kind of don't. Some examples:
func
expands to nothing:print
doesn't evoke any completion options at all:I also periodically see the following error in the status bar:
source languageserver.swift timeout after 2000ms
Do I have something configured incorrectly, or is this thing just not ready? Thanks.