File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,15 +15,19 @@ public final class OpenedFileRecoverableStorage {
1515 var openedFiles = Set ( dict [ projectRootURL. path] as? [ String ] ?? [ ] )
1616 openedFiles. insert ( fileURL. path)
1717 dict [ projectRootURL. path] = Array ( openedFiles)
18- userDefault. set ( dict, forKey: key)
18+ Task { @MainActor [ dict] in
19+ userDefault. set ( dict, forKey: key)
20+ }
1921 }
2022
2123 public func closeFile( fileURL: URL ) {
2224 var dict = userDefault. dictionary ( forKey: key) ?? [ : ]
2325 var openedFiles = dict [ projectRootURL. path] as? [ String ] ?? [ ]
2426 openedFiles. removeAll ( where: { $0 == fileURL. path } )
2527 dict [ projectRootURL. path] = openedFiles
26- userDefault. set ( dict, forKey: key)
28+ Task { @MainActor [ dict] in
29+ userDefault. set ( dict, forKey: key)
30+ }
2731 }
2832
2933 public var openedFiles : [ URL ] {
You can’t perform that action at this time.
0 commit comments