{"action":"created","issue":{"url":"https://api.github.com/repos/nathankot/company-sourcekit/issues/4","labels_url":"https://api.github.com/repos/nathankot/company-sourcekit/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/nathankot/company-sourcekit/issues/4/comments","events_url":"https://api.github.com/repos/nathankot/company-sourcekit/issues/4/events","html_url":"https://github.com/nathankot/company-sourcekit/issues/4","id":116693718,"number":4,"title":"Project-specific completion","user":{"login":"nathankot","id":1400871,"avatar_url":"https://avatars.githubusercontent.com/u/1400871?v=3","gravatar_id":"","url":"https://api.github.com/users/nathankot","html_url":"https://github.com/nathankot","followers_url":"https://api.github.com/users/nathankot/followers","following_url":"https://api.github.com/users/nathankot/following{/other_user}","gists_url":"https://api.github.com/users/nathankot/gists{/gist_id}","starred_url":"https://api.github.com/users/nathankot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathankot/subscriptions","organizations_url":"https://api.github.com/users/nathankot/orgs","repos_url":"https://api.github.com/users/nathankot/repos","events_url":"https://api.github.com/users/nathankot/events{/privacy}","received_events_url":"https://api.github.com/users/nathankot/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-11-13T03:32:46Z","updated_at":"2015-12-06T14:46:50Z","closed_at":"2015-12-06T02:41:50Z","body":"Will need to derive and send the correct flags to sourcekitten. It's best that this happens automatically simply by inspecting the `.xcodeproj` or `.xcworkspace`.\r\n\r\nHere is what XCode sends to sourcekit when doing completion in a project:\r\n\r\nI don't think everything is required but we should try to emulate the important bits:\r\n\r\n```json\r\n  key.compilerargs: [\r\n    \"-module-name\",\r\n    \"Rumuki\",\r\n    \"-O\",\r\n    \"-DAPI_NATHAN\",\r\n    \"-DDEBUG\",\r\n    \"-sdk\",\r\n    \"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk\",\r\n    \"-target\",\r\n    \"x86_64-apple-ios8.0\",\r\n    \"-g\",\r\n    \"-module-cache-path\",\r\n    \"/Users/nathan/Library/Developer/Xcode/DerivedData/ModuleCache\",\r\n    \"-Xfrontend\",\r\n    \"-serialize-debugging-options\",\r\n    \"-I\",\r\n    \"/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Products/Nathan-iphonesimulator\",\r\n    \"-F\",\r\n    \"/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Products/Nathan-iphonesimulator\",\r\n    \"-F\",\r\n    \"/Users/nathan/Development/Apps/rumuki/ios/Carthage/Build/iOS\",\r\n    \"-c\",\r\n    \"-j4\",\r\n    \"/Users/nathan/Development/Apps/rumuki/ios/Rumuki/Cryptography/CryptHelpers.swift\",\r\n    \"/Users/nathan/Development/Apps/rumuki/ios/Rumuki/HTTP/Api.swift\",\r\n    \"/Users/nathan/Development/Apps/rumuki/ios/Rumuki/UserInterface/Components/RecordingListEmptyBackgroundComponent.swift\",\r\n    \"/Users/nathan/Development/Apps/rumuki/ios/Rumuki/AudioVideo/Library/AVCNALHelpers.swift\",\r\n   \"/* ... long list of source files */\",\r\n    \"-emit-module\",\r\n    \"-emit-module-path\",\r\n    \"/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/Objects-normal/x86_64/Rumuki.swiftmodule\",\r\n    \"-Xcc\",\r\n    \"-I/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/swift-overrides.hmap\",\r\n    \"-Xcc\",\r\n    \"-iquote\",\r\n    \"-Xcc\",\r\n    \"/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/Rumuki-generated-files.hmap\",\r\n    \"-Xcc\",\r\n    \"-I/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/Rumuki-own-target-headers.hmap\",\r\n    \"-Xcc\",\r\n    \"-I/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/Rumuki-all-non-framework-target-headers.hmap\",\r\n    \"-Xcc\",\r\n    \"-ivfsoverlay\",\r\n    \"-Xcc\",\r\n    \"/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/all-product-headers.yaml\",\r\n    \"-Xcc\",\r\n    \"-iquote\",\r\n    \"-Xcc\",\r\n    \"/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/Rumuki-project-headers.hmap\",\r\n    \"-Xcc\",\r\n    \"-I/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Products/Nathan-iphonesimulator/include\",\r\n    \"-Xcc\",\r\n    \"-I/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/DerivedSources/x86_64\",\r\n    \"-Xcc\",\r\n    \"-I/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/DerivedSources\",\r\n    \"-Xcc\",\r\n    \"-DDEBUG=1\",\r\n    \"-Xcc\",\r\n    \"-DDEBUG=1\",\r\n    \"-emit-objc-header\",\r\n    \"-emit-objc-header-path\",\r\n    \"/Users/nathan/Library/Developer/Xcode/DerivedData/Rumuki-famrqdkrtmqhvkawkbxggtwiipsp/Build/Intermediates/Rumuki.build/Nathan-iphonesimulator/Rumuki.build/Objects-normal/x86_64/Rumuki-Swift.h\",\r\n    \"-import-objc-header\",\r\n    \"/Users/nathan/Development/Apps/rumuki/ios/Rumuki/BridgingHeader.h\",\r\n    \"-Xcc\",\r\n    \"-working-directory/Users/nathan/Development/Apps/rumuki/ios\"\r\n  ]\r\n```"},"comment":{"url":"https://api.github.com/repos/nathankot/company-sourcekit/issues/comments/162321767","html_url":"https://github.com/nathankot/company-sourcekit/issues/4#issuecomment-162321767","issue_url":"https://api.github.com/repos/nathankot/company-sourcekit/issues/4","id":162321767,"user":{"login":"nathankot","id":1400871,"avatar_url":"https://avatars.githubusercontent.com/u/1400871?v=3","gravatar_id":"","url":"https://api.github.com/users/nathankot","html_url":"https://github.com/nathankot","followers_url":"https://api.github.com/users/nathankot/followers","following_url":"https://api.github.com/users/nathankot/following{/other_user}","gists_url":"https://api.github.com/users/nathankot/gists{/gist_id}","starred_url":"https://api.github.com/users/nathankot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathankot/subscriptions","organizations_url":"https://api.github.com/users/nathankot/orgs","repos_url":"https://api.github.com/users/nathankot/repos","events_url":"https://api.github.com/users/nathankot/events{/privacy}","received_events_url":"https://api.github.com/users/nathankot/received_events","type":"User","site_admin":false},"created_at":"2015-12-06T14:46:50Z","updated_at":"2015-12-06T14:46:50Z","body":"Sweet, company-sourcekit's linux support should hopefully just depend on sourcekittendaemon"}}