MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / FetchSuggestions

Function FetchSuggestions

pkg/suggestion/suggestion.go:139–147  ·  view source on GitHub ↗
(ctx context.Context, data wshrpc.FetchSuggestionsData)

Source from the content-addressed store, hash-verified

137}
138
139func 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
149func filterBookmarksForValid(bookmarks map[string]wconfig.WebBookmark) map[string]wconfig.WebBookmark {
150 validBookmarks := make(map[string]wconfig.WebBookmark)

Callers 2

Calls 2

fetchFileSuggestionsFunction · 0.85
fetchBookmarkSuggestionsFunction · 0.85

Tested by

no test coverage detected