(ctx context.Context, data wshrpc.FetchSuggestionsData)
| 137 | } |
| 138 | |
| 139 | func FetchSuggestions(ctx context.Context, data wshrpc.FetchSuggestionsData) (*wshrpc.FetchSuggestionsResponse, error) { |
| 140 | if data.SuggestionType == "file" { |
| 141 | return fetchFileSuggestions(ctx, data) |
| 142 | } |
| 143 | if data.SuggestionType == "bookmark" { |
| 144 | return fetchBookmarkSuggestions(ctx, data) |
| 145 | } |
| 146 | return nil, fmt.Errorf("unsupported suggestion type: %q", data.SuggestionType) |
| 147 | } |
| 148 | |
| 149 | func filterBookmarksForValid(bookmarks map[string]wconfig.WebBookmark) map[string]wconfig.WebBookmark { |
| 150 | validBookmarks := make(map[string]wconfig.WebBookmark) |
no test coverage detected