Этот коммит содержится в:
=Corey Hulen
2016-01-08 12:41:26 -06:00
родитель 001a4448ca
Коммит 3fba8e42b1
17 изменённых файлов: 578 добавлений и 78 удалений

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

@@ -747,20 +747,28 @@ export function savePreferences(preferences, success, error) {
}
export function getSuggestedCommands(command, suggestionId, component) {
client.executeCommand(
'',
command,
true,
client.listCommands(
(data) => {
var matches = [];
data.forEach((cmd) => {
if (('/' + cmd.trigger).indexOf(command) === 0) {
matches.push({
suggestion: '/' + cmd.trigger + ' ' + cmd.auto_complete_hint,
description: cmd.auto_complete_desc
});
}
});
// pull out the suggested commands from the returned data
const terms = data.suggestions.map((suggestion) => suggestion.suggestion);
//const terms = matches.map((suggestion) => suggestion.trigger);
const terms = matches.map((suggestion) => suggestion.suggestion);
AppDispatcher.handleServerAction({
type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
id: suggestionId,
matchedPretext: command,
terms,
items: data.suggestions,
items: matches,
component
});
},