Hey @Nathan_Hawes (or other helpful person you may be reading this),
So, I'm looking at my next issue and I'm having some trouble with sourcekitd-test
. Hopefully I'm just missing something dumb.
This is my test file:
import MessageUI.MFMailComposeViewController
func test() {
final class MailDelegate: NSObject, MFMailComposeViewControllerDelegate {
func mailComposeController(_ controller: MFMailComposeViewController,
didFinishWith result: MFMailComposeResult,
error: Error?) {}
}
}
Running sk-stress-test for this file results in the following:
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2019-07-03-a.xctoolchain/usr/bin/sk-stress-test -r CursorInfo -m none /Users/cschlosser/workspace/sourcekit-errors/lib/Navigator/Test.swift swiftc -sdk /Applications/Xcode-11.Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk -target x86_64-apple-ios11.0-simulator /Users/cschlosser/workspace/sourcekit-errors/lib/Navigator/Test.swift
Failure detected: SourceKit returned an error response
request: SemanticRefactoring (Local Rename) in /Users/cschlosser/workspace/sourcekit-errors/lib/Navigator/Test.swift at offset 145 with args: -sdk /Applications/Xcode-11.Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk -target x86_64-apple-ios11.0-simulator /Users/cschlosser/workspace/sourcekit-errors/lib/Navigator/Test.swift
response: error response (Request Failed): <unknown>:0: error: value decl ''mailComposeController(_:didFinishWith:error:)'' has no declaration location
-- begin file content --------
<unmodified>
-- end file content ----------
I'm running sourcekitd-test
from xcode with the following arguments:
-req=cursor -offset=145 -cursor-action /Users/cschlosser/workspace/sourcekit-errors/lib/Navigator/Test.swift -- -sdk /Applications/Xcode-11.Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk -target x86_64-apple-ios11.0-simulator /Users/cschlosser/workspace/sourcekit-errors/lib/Navigator/Test.swift
It ends up failing and exiting with this error: did not find primary SourceFile
and yes, I did make sure that the file does actually exist
It's also really slow, but that's probably just using a debug build.
Also in case it's helpful this the the sourcekit request that sourcekitd-test
prints out:
{
key.request: source.request.cursorinfo,
key.compilerargs: [
"-sdk",
"/Applications/Xcode-11.Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk",
"-target",
"x86_64-apple-ios11.0-simulator",
"/Users/cschlosser/workspace/sourcekit-errors/lib/Navigator/Test.swift"
],
key.offset: 145,
key.sourcefile: "/Users/cschlosser/workspace/sourcekit-errors/lib/Navigator/Test.swift",
key.retrieve_refactor_actions: 1
}
Thanks again!