We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 134506a commit 10e7ad3Copy full SHA for 10e7ad3
Tool/Sources/Workspace/WorkspacePool.swift
@@ -61,6 +61,15 @@ public class WorkspacePool {
61
}
62
63
public func fetchFilespaceIfExisted(fileURL: URL) -> Filespace? {
64
+ // We prefer to get the filespace from the current active workspace.
65
+ // Just incase there are multiple workspaces opened with the same file.
66
+ if let currentWorkspaceURL = XcodeInspector.shared.realtimeActiveWorkspaceURL {
67
+ if let workspace = workspaces[currentWorkspaceURL],
68
+ let filespace = workspace.filespaces[fileURL]
69
+ {
70
+ return filespace
71
+ }
72
73
for workspace in workspaces.values {
74
if let filespace = workspace.filespaces[fileURL] {
75
return filespace
0 commit comments