File tree 1 file changed +15
-0
lines changed
CodeEdit/Features/Welcome/Views
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 6
6
//
7
7
8
8
import SwiftUI
9
+ import CoreSpotlight
9
10
10
11
struct RecentProjectsListView : View {
11
12
@@ -25,6 +26,20 @@ struct RecentProjectsListView: View {
25
26
let projectsURL = recentProjectPaths. map { URL ( filePath: $0) }
26
27
_selection = . init( initialValue: Set ( projectsURL. prefix ( 1 ) ) )
27
28
_recentProjects = . init( initialValue: projectsURL)
29
+ donateSearchableItems ( )
30
+ }
31
+ func donateSearchableItems( ) {
32
+ let searchableItems = recentProjects. map { entity -> CSSearchableItem in
33
+ let attributeSet = CSSearchableItemAttributeSet ( contentType: . content)
34
+ attributeSet. title = String ( entity. lastPathComponent)
35
+ attributeSet. relatedUniqueIdentifier = String ( entity. path ( ) )
36
+ return CSSearchableItem (
37
+ uniqueIdentifier: String ( entity. path ( ) ) ,
38
+ domainIdentifier: " app.codeedit.CodeEdit.ProjectItem " ,
39
+ attributeSet: attributeSet
40
+ )
41
+ }
42
+ CSSearchableIndex . default ( ) . indexSearchableItems ( searchableItems)
28
43
}
29
44
30
45
var listEmptyView : some View {
You can’t perform that action at this time.
0 commit comments