Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module support #270

Closed
vdka opened this issue Oct 16, 2016 · 2 comments · Fixed by #275
Closed

Module support #270

vdka opened this issue Oct 16, 2016 · 2 comments · Fixed by #275

Comments

@vdka
Copy link
Contributor

vdka commented Oct 16, 2016

I am working on a tool to parse the .yaml file produced by SwiftPM and use that to detect the argument's I need to pass to sourcekitten.

Current call looks like this

sourcekitten complete --text '
import JSON

let json: JSON = ["key": true]

json.arr
' --offset 102 -- 
-j8 -D SWIFT_PACKAGE -Onone -g -enable-testing 
-F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks 
-target x86_64-apple-macosx10.10 
-sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk 
-module-cache-path /Users/Ethan/tmp/swiftkitTest/.build/debug/ModuleCache 
-I /Users/Ethan/Sources/vdka/cj/.build/debug 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/Constants.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/Expressible.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSON.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSONAccessors.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSONConvertible.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSONError.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSONInitializable.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSONOptionalExtensions.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSONParser.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSONRepresentable.swift 
/Users/Ethan/tmp/swiftkitTest/Packages/JSON-0.12.1/Sources/JSON/JSONSerializer.swift 
/Users/Ethan/tmp/swiftkitTest/Sources/main.swift

This work's fine until there are multiple packages. Working with Server Side Swift framework's there are a huge number of source files and when including them all sourcekitten times out or just doesn't respond in reasonable time.

I was wondering if it were possible to pass the flags to the already build .swiftmodule files somehow to get them to be used for completion?

@jpsim
Copy link
Owner

jpsim commented Oct 18, 2016

There's already some code to parse SPM's yaml build files that was added for SPM support to SourceKitten's doc command in #211. We could certainly share that with some of the other commands that benefit/require compiler arguments.

@vdka
Copy link
Contributor Author

vdka commented Oct 18, 2016

If the code is already largely written then I will have a look at implementing this soon. Should be fairly straight forward I imagine.

vdka added a commit to vdka/SourceKitten that referenced this issue Oct 18, 2016
Adds support for reading the build commands from the `build.yaml` file
closes jpsim#270
vdka added a commit to vdka/SourceKitten that referenced this issue Oct 18, 2016
Adds support for reading the build commands from the `build.yaml` file
closes jpsim#270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants