vknabel / vscode-swift-development-environment

New home of Swift Development Environment for VS Code
https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swift-development-environment
Apache License 2.0
175 stars 14 forks source link

Error message running on swift 4.1 #12

Closed alexandru-calinoiu closed 6 years ago

alexandru-calinoiu commented 6 years ago

I am trying the extension with swift 4.1 and VSCode 1.22.1 on Ubuntu, but I get the following error:

[Error - 4:12:03 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: This socket has been ended by the other party
  Code: -32603 
vknabel commented 6 years ago

@alexandru-calinoiu thanks for the feedback! Did you upgrade to Swift 4.1 after initially installing sourcekite? In that case you might have to recompile it.

Did the autocompletion completely stop after initially getting this error? Does a vscode restart help (at least temporarily and as a workaround)?

In case it is project related: is the project open source or can you reproduce your issue in a smaller project? It may help a lot if we could talk about an explicit code base.

alexandru-calinoiu commented 6 years ago

I had a fresh install of swift 4, vs code restart does not work :(

The project is just the template of the perfect framework

vknabel commented 6 years ago

Sorry for the late response. I did not find enough time to set up a VM. What happens if you do the following on your bash?

$ /path/to/your/sourcekite
1
{
key.request: source.request.protocol_version
}

Do you receive the following output? (You need to terminate it manually using ctrl+c afterwards) If so sourcekite would be set up properly. The /path/to/your/sourcekite should be included within your vscode settings as "swift.path.sourcekite": "/path/to/your/sourcekite".

{
  key.version_major: 1,
  key.version_minor: 0
}

If it still doesn't work: does your path contain any special characters like spaces?

alexandru-calinoiu commented 6 years ago

I've updated to ubuntu 18.04 and I am not able to test this anymore because swift does not work there anymore.

dcartman commented 6 years ago

I'm running on macOS, swift 4.1, compiled source kite with swift 4.1, updated to most recent version of MSDE (2.4.3).

Pointing at the debug build of sourcekite I am getting these errors:

/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/out/src/server/sourcekites.js:88 throw new Error("wrong format for reqid"); ^

Error: wrong format for reqid at SourcekiteResponseHandler.handleResponse (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/out/src/server/sourcekites.js:88:23) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at readableAddChunk (_stream_readable.js:178:18) at Socket.Readable.push (_stream_readable.js:136:10) at Pipe.onread (net.js:560:20) [Info - 1:39:54 PM] Connection to server got closed. Server will restart. [Error - 1:39:54 PM] Request textDocument/hover failed. Error: Connection got disposed. at Object.dispose (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-jsonrpc/lib/main.js:825:25) at Object.dispose (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-languageclient/lib/client.js:57:35) at LanguageClient.handleConnectionClosed (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-languageclient/lib/client.js:1983:42) at LanguageClient.handleConnectionClosed (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-languageclient/lib/main.js:126:15) at closeHandler (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-languageclient/lib/client.js:1970:18) at CallbackList.invoke (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-jsonrpc/lib/events.js:135:36) at closeHandler (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-jsonrpc/lib/main.js:221:26) at CallbackList.invoke (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-jsonrpc/lib/events.js:71:39) at Emitter.fire (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-jsonrpc/lib/events.js:135:36) at IPCMessageReader.AbstractMessageReader.fireClose (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-jsonrpc/lib/messageReader.js:135:27) at ChildProcess. (/Users/daniel/.vscode/extensions/vknabel.vscode-swift-development-environment-2.4.3/node_modules/vscode-jsonrpc/lib/messageReader.js:253:61) at emitTwo (events.js:111:20) at ChildProcess.emit (events.js:194:7) at maybeClose (internal/child_process.js:899:16) at Socket. (internal/child_process.js:342:11) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at Pipe._handle.close [as _onclose] (net.js:510:12)

dcartman commented 6 years ago

Before updating the latest version of MSDE, autocompletion was not presenting any results or errors.

If I run sourcekite from the command line, I'm getting this output:

~/Repos/sourcekite/.build/x86_64-apple-macosx10.10/debug/sourcekite |||[main.swift:34] sourcekite - sourcekitd_initialize 1 |||[main.swift:42] sourcekite - state: endRequest |||[main.swift:43] sourcekite - input: 1 |||[main.swift:44] sourcekite - input length: 1

vknabel commented 6 years ago

Moved this into #26

vknabel commented 6 years ago

Should be fixed by #34. If not re-open or create a new issue