facebookarchive / nuclide

An open IDE for web and native mobile development, built on top of Atom
https://nuclide.io
Other
7.79k stars 682 forks source link

[nuclide-swift] "An error occurred when invoking SourceKitten" (autocompletion) #1552

Closed pkrll closed 5 years ago

pkrll commented 6 years ago

Issue and Steps to Reproduce

If I have Sourcekitten enabled, and try to write something Atom throws an error, stating that "an error occurred when invoking SourceKitten".

I installed Nuclide through Atom, SourceKitten with Homebrew (symlinked in /usr/local/bin). I did build the project using Nuclide first.

Nuclide-swift settings:

screen shot 2018-06-14 at 00 47 00

Expected Behavior

I should get autocompletion.

Actual Behavior

I get an error:

screen shot 2018-06-14 at 00 41 01
An error occurred when invoking SourceKitten
Please file a bug.
exit code: 1
stdout:

stderr:
The operation couldn’t be completed. (SourceKittenFramework.Request.Error error 2.)

command:
complete --text import Foundation

let fileManager = FileManager.default
--offset 19 -- -swift-version 4 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Onone -g -enable-testing -j4 -DSWIFT_PACKAGE -module-cache-path /Users/path/to/project/.build/x86_64-apple-macosx10.10/debug/ModuleCache (+ a bunch of other files in the project...)

Versions

Additional Details

joscdk commented 6 years ago

I am experiencing same error, i have tried both with:

brew install sourcekitten

(Installs v. 0.20.0)

And by manually building sourcekitten with

swift build

(Installs v. 0.21.0)

I have included a screenshot of the error sidebar, that shows every time i try to write something :)

screen shot 2018-06-17 at 11 16 48 pm
yeswolf commented 6 years ago

The patch attached fixes this issue and probably #1002 completion.txt. Can't dedicate my time to the pull request now, probably someone can integrate it.

pelmers commented 5 years ago

@yeswolf I cleaned up your patch and applied it, but I couldn't confirm whether it works because the swift integration is no longer actively maintained.