What I would otherwise forget
July 2017
Some spells for testing SourceKit.
Setup:
alias st=/Users/johnf/project/swift-source/build/jfdev/swift-macosx-x86_64/bin/sourcekitd-test
Simple tests against files, no imports:
st -req=structure ${PWD}/test.swift -- ${PWD}/test.swift`
Add Foundation etc:
st -req=structure -using-swift-args ${PWD}/test.swift -- \
${PWD}/test.swift \
-sdk `xcrun --sdk macosx --show-sdk-path`
CursorInfo:
st -req=cursor -offset=XXX -print-response-as-json \
${PWD}/test.swift -- ${PWD}/test.swift
Setup:
alias si=/Users/johnf/project/swift-source/build/jfdev/swift-macosx-x86_64/bin/swift-ide-test
Structure query:
si -structure -source-filename test.swift
To get some idea of what Xcode is doing and how happy it feels, after switching to custom toolchain:
SOURCEKIT_LOGGING=3 /Applications/Xcode-beta.app/Contents/MacOS/Xcode 2>&1 | tee log