We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4cf3cc7 commit 6753da1Copy full SHA for 6753da1
Core/Sources/Service/Workspace.swift
@@ -89,6 +89,13 @@ final class Workspace {
89
static func fetchOrCreateWorkspaceIfNeeded(fileURL: URL) async throws
90
-> (workspace: Workspace, filespace: Filespace)
91
{
92
+ // never create duplicated filespaces
93
+ for workspace in workspaces.values {
94
+ if let filespace = workspace.filespaces[fileURL] {
95
+ return (workspace, filespace)
96
+ }
97
98
+
99
let projectURL = try await Environment.fetchCurrentProjectRootURL(fileURL)
100
let workspaceURL = projectURL ?? fileURL
101
let workspace = workspaces[workspaceURL] ?? Workspace(projectRootURL: workspaceURL)
0 commit comments