🍎(in-progress) XCode LSP with Emacs
A random collection of stuff before I actually write a real guide
Use xcodebuild to list schemes
Use xcode-build-server config to configure a buildServer.json
The lsp-sourcekit package will be able to handle all languages from then on
REQUIRES a build from XCode (very annoying): Product > Build For > Running
Based on the source codes (https://github.com/SolaWing/xcode-build-server/blob/master/server.py and https://github.com/apple/sourcekit-lsp/blob/main/Sources/SKCore/BuildServerBuildSystem.swift#L181), there are three important things that need to exist:
indexDatabasePath: Typically in `~/Library/Caches/xcode-build-server/-Users-name-path-to-project/indexDatabasePath-*`
indexStorePath: Typically in
~/Library/Developer/Xcode/DerivedData/ProjectName-hashlike/Index.noindex/DataStore
compile_file: Typically called
~/Library/Caches/xcode-build-server/-Users-name-path-to-project/compile_file-ProjectName-md5Hash
For god knows what reason, when you do
xcodebuild -workspace ... -scheme ...
, you only getindexDatabasePath
andindexStorePath
. compile_file can only be generated by xcode (the app)There's probably a root cause for this, but I can't be bothered
So, for a project to be successfully, fully indexed, you need to build at least once in xcode (the app). This is a problem if you're trying to bypass signing with CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=""
TODO: Put the other commands here
Last updated