Adding explicit returns

This commit is contained in:
Matt Bierner
2017-02-01 17:06:13 -08:00
parent f1abc274df
commit 406014ae97
20 changed files with 71 additions and 22 deletions

View File

@@ -270,6 +270,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(typeConverters.location.to);
}
return undefined;
});
}
@@ -282,6 +283,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(typeConverters.location.to);
}
return undefined;
});
}
@@ -294,6 +296,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(typeConverters.toHover);
}
return undefined;
});
}
@@ -306,6 +309,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(typeConverters.toDocumentHighlight);
}
return undefined;
});
}
@@ -318,6 +322,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(typeConverters.location.to);
}
return undefined;
});
}
@@ -329,7 +334,7 @@ export class ExtHostApiCommands {
};
return this._commands.executeCommand<modes.WorkspaceEdit>('_executeDocumentRenameProvider', args).then(value => {
if (!value) {
return;
return undefined;
}
if (value.rejectReason) {
return TPromise.wrapError(value.rejectReason);
@@ -352,6 +357,7 @@ export class ExtHostApiCommands {
if (value) {
return typeConverters.SignatureHelp.to(value);
}
return undefined;
});
}
@@ -366,6 +372,7 @@ export class ExtHostApiCommands {
const items = result.suggestions.map(suggestion => typeConverters.Suggest.to(position, suggestion));
return new types.CompletionList(items, result.incomplete);
}
return undefined;
});
}
@@ -377,6 +384,7 @@ export class ExtHostApiCommands {
if (value && Array.isArray(value.entries)) {
return value.entries.map(typeConverters.SymbolInformation.fromOutlineEntry);
}
return undefined;
});
}
@@ -387,7 +395,7 @@ export class ExtHostApiCommands {
};
return this._commands.executeCommand<modes.CodeAction[]>('_executeCodeActionProvider', args).then(value => {
if (!Array.isArray(value)) {
return;
return undefined;
}
return value.map(quickFix => this._commands.converter.fromInternal(quickFix.command));
});
@@ -403,6 +411,7 @@ export class ExtHostApiCommands {
this._commands.converter.fromInternal(item.symbol.command));
});
}
return undefined;
});
}
@@ -415,6 +424,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(edit => new types.TextEdit(typeConverters.toRange(edit.range), edit.text));
}
return undefined;
});
}
@@ -428,6 +438,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(edit => new types.TextEdit(typeConverters.toRange(edit.range), edit.text));
}
return undefined;
});
}
@@ -442,6 +453,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(edit => new types.TextEdit(typeConverters.toRange(edit.range), edit.text));
}
return undefined;
});
}
@@ -450,6 +462,7 @@ export class ExtHostApiCommands {
if (Array.isArray(value)) {
return value.map(typeConverters.DocumentLink.to);
}
return undefined;
});
}
}