Review uses of Promise.resolve(null)

Many `Promise.resolve(null)` should actually be `Promise.resolve(void 0)`. In other cases, we were missing a null return annotation.
This commit is contained in:
Matt Bierner
2018-12-13 15:41:13 -08:00
parent 68a4e01246
commit d40fa4a27e
48 changed files with 109 additions and 109 deletions

View File

@@ -67,7 +67,7 @@ export class ExtHostComments implements ExtHostCommentsShape {
};
}
$createNewCommentThread(handle: number, uri: UriComponents, range: IRange, text: string): Promise<modes.CommentThread> {
$createNewCommentThread(handle: number, uri: UriComponents, range: IRange, text: string): Promise<modes.CommentThread | null> {
const data = this._documents.getDocumentData(URI.revive(uri));
const ran = <vscode.Range>extHostTypeConverter.Range.to(range);
@@ -81,7 +81,7 @@ export class ExtHostComments implements ExtHostCommentsShape {
}).then(commentThread => commentThread ? convertToCommentThread(provider, commentThread, this._commandsConverter) : null);
}
$replyToCommentThread(handle: number, uri: UriComponents, range: IRange, thread: modes.CommentThread, text: string): Promise<modes.CommentThread> {
$replyToCommentThread(handle: number, uri: UriComponents, range: IRange, thread: modes.CommentThread, text: string): Promise<modes.CommentThread | null> {
const data = this._documents.getDocumentData(URI.revive(uri));
const ran = <vscode.Range>extHostTypeConverter.Range.to(range);
@@ -154,7 +154,7 @@ export class ExtHostComments implements ExtHostCommentsShape {
}).then(commentInfo => commentInfo ? convertCommentInfo(handle, provider, commentInfo, this._commandsConverter) : null);
}
$provideWorkspaceComments(handle: number): Promise<modes.CommentThread[]> {
$provideWorkspaceComments(handle: number): Promise<modes.CommentThread[] | null> {
const provider = this._workspaceProviders.get(handle);
if (!provider) {
return Promise.resolve(null);