             guard let url = results.first else {
                 throw LayoutError.message("Unable to locate source file for \(path)")
             }
-            _sourceURLCache[path] = url
+            _setSourceURL(url, for: path)
         }
         return results.first
     }
 
     private func _setSourceURL(_ sourceURL: URL, for path: String) {
-        _sourceURLCache[path] = sourceURL
+        guard sourceURL.isFileURL else {
+            preconditionFailure()
+        }
+        sourcePaths[path] = sourceURL.path
     }
 
 #else


    // MARK: Only applicable when running in the simulator

    private var _projectDirectory: URL?
    private var _sourceURLCache = [String: URL]()

    private func findProjectDirectory(at path: String) -> URL? {
        if let projectDirectory = _projectDirectory, path.hasPrefix(projectDirectory.path) {

    }

    private func findSourceURL(forRelativePath path: String, in directory: URL, usingCache: Bool = true) throws -> URL? {
        if let filePath = sourcePaths[path], FileManager.default.fileExists(atPath: filePath) {
            return URL(fileURLWithPath: filePath)
        }
        guard let files = try? FileManager.default.contentsOfDirectory(atPath: directory.path) else {
            return nil
