Moved action creation for suggestions

Этот коммит содержится в:
hmhealey
2015-12-02 09:21:58 -05:00
родитель 06e0919bca
Коммит 07f0df6af4
5 изменённых файлов: 63 добавлений и 47 удалений

Просмотреть файл

@@ -731,3 +731,27 @@ export function savePreferences(preferences, success, error) {
}
);
}
export function getSuggestedCommands(command, suggestionId, component) {
client.executeCommand(
'',
command,
true,
(data) => {
// pull out the suggested commands from the returned data
const terms = data.suggestions.map((suggestion) => suggestion.suggestion);
AppDispatcher.handleServerAction({
type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
id: suggestionId,
matchedPretext: command,
terms,
items: data.suggestions,
component
});
},
(err) => {
dispatchError(err, 'getCommandSuggestions');
}
);
}