-
Notifications
You must be signed in to change notification settings - Fork 683
[nuclide-swift] Support Linux #678
Comments
SourceKitten is now somewhat compatible with Linux considering the instructions on their README. Also, jpsim/SourceKitten#223 was closed in favor of jpsim/SourceKitten#268 I've had limited success running a Docker image based on norionomura/sourcekit:30 image in an Arch host and editing this line to allow SourceKitten execution on non-Darwin platforms. The autocomplete seems to be not so responsive and limited to Foundation or current file types, ignoring any imports from SPM dependencies, which I'm not sure if it's a nuclide-swift or SourceKitten issue to be honest since it could be related to the current "partial" requirement of a Swift 3 toolchain on SourceKitten's master. Versions:
|
Awesome, thanks for trying it out! One thing to note: autocompletion requires you to first build the Swift package via the task runner toolbar (see the docs; sorry I'd link them but I'm on a plane and the WiFi is super slow). Are you saying that autocompletion is limited to just the current file on Linux, even though it works well when you try it on macOS? |
Yeah, I did build it a few times using the toolbar, making changes and seeing if the autocomplete would report them properly. I can't really try it on a macOS machine right now and didn't use nuclide for swift development on a mac when I could - what I said about it being limited is mostly based on what I expected from such a functionality, e.g., pressing |
Hmm... I don't have any ideas off the top of my head. If you have some time to plug away at it, maybe try to diagnose the issue, that'd be awesome. Otherwise hang tight, I'll try to get to it soon. |
Recently I tried to test autocompletion on linux with latest sourcekitten. Still not work (I followed the steps above, removed check for non-darwin systems and compiled code before testing).
|
That's strange. The error message you're seeing is coming from the Swift compiler. I would certainly expect this error message to be the same regardless of whether you invoke The nuclide-swift packages passes an additional set of compiler flags to SourceKitten here. It looks like those flags may be causing the Swift compiler to produce that error. That's strange, since the commands should be the exact ones included in the YAML file SwiftPM produces. The best way to diagnose the issue would be to add a |
Did more tests yesterday. Found location where sourcekitten works properly. Issue was related with libraries of sourcekit. |
So it was an issue with SourceKit and SourceKitten? Is there an issue on the SourceKitten repository, or a Swift JIRA bug report that explains what the issue was? I'm curious to see if I can help. :) |
As you could understand sourcekit, sourcekitten were builded using docker, link. Norio Nomura has implemented custom build for sourcekit (link) in on linux, which not contains in main swift repo.
To use sourcekitten I needed launch atom using terminal (sourcekitten should use env vars for normal work). |
Thanks for the detailed report! It sounds like SourceKitten on Linux requires some additional environment variables to be set. Perhaps the best way forward is to provide Nuclide configuration options for those paths, so that users may set them to the correct paths and get SourceKitten working.
This is definitely supported! I've only ever used nuclide-swift on macOS, and it can do autocompletion across files there. In fact, that's the main reason I built this package. :) |
It's great. But it doesn't work for me. |
Hmm... I assume you did, but just in case: did you build the package via the task runner toolbar after having added both I'll try to take a closer look at this over the weekend. |
Yes, I did. |
Tested this myself, works on command line but not in the editor. |
Failed to load Sourcekit |
what to so |
do* |
Issue and Steps to Reproduce
Originally reported by @zxw454034941.
Expected Behavior
Autocompletion works, just as it would on macOS.
Actual Behavior
Autocompletion results from SourceKit do not appear.
Versions
I think any official announcement of Linux support in nuclide-swift can wait until after jpsim/SourceKitten#223 is merged, but it would be nice to investigate what the issue is here beforehand.
The text was updated successfully, but these errors were encountered: