mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Adding explicit returns for remaining instances
This commit is contained in:
@@ -146,7 +146,7 @@ export function createApiFactory(initData: IInitData, threadService: IThreadServ
|
||||
let activeTextEditor = extHostEditors.getActiveTextEditor();
|
||||
if (!activeTextEditor) {
|
||||
console.warn('Cannot execute ' + id + ' because there is no active text editor.');
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return activeTextEditor.edit((edit: vscode.TextEditorEdit) => {
|
||||
@@ -185,6 +185,7 @@ export function createApiFactory(initData: IInitData, threadService: IThreadServ
|
||||
if (desc) {
|
||||
return new Extension(extensionService, desc);
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
get all(): Extension<any>[] {
|
||||
return extensionService.getAllExtensionDescriptions().map((desc) => new Extension(extensionService, desc));
|
||||
@@ -523,7 +524,7 @@ function createExtensionPathIndex(extensionService: ExtHostExtensionService): TP
|
||||
const trie = new TrieMap<IExtensionDescription>(TrieMap.PathSplitter);
|
||||
const extensions = extensionService.getAllExtensionDescriptions().map(ext => {
|
||||
if (!ext.main) {
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
return new TPromise((resolve, reject) => {
|
||||
realpath(ext.extensionFolderPath, (err, path) => {
|
||||
|
||||
@@ -100,6 +100,7 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape {
|
||||
workspaceValue: config.workspace
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ export class ExtHostDocumentSaveParticipant extends ExtHostDocumentSaveParticipa
|
||||
|
||||
if (didTimeout) {
|
||||
// timeout - no more listeners
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const document = this._documents.getDocumentData(resource).document;
|
||||
@@ -150,7 +150,7 @@ export class ExtHostDocumentSaveParticipant extends ExtHostDocumentSaveParticipa
|
||||
// apply edits iff any and iff document
|
||||
// didn't change somehow in the meantime
|
||||
if (edits.length === 0) {
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (version === document.version) {
|
||||
|
||||
@@ -78,12 +78,13 @@ export class ExtHostDocuments extends ExtHostDocumentsShape {
|
||||
|
||||
public getDocumentData(resource: vscode.Uri): ExtHostDocumentData {
|
||||
if (!resource) {
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
const data = this._documentData.get(resource.toString());
|
||||
if (data) {
|
||||
return data;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public ensureDocumentData(uri: URI): TPromise<ExtHostDocumentData> {
|
||||
|
||||
@@ -656,6 +656,7 @@ class ExtHostTextEditor implements vscode.TextEditor {
|
||||
return TPromise.wrapError(silent);
|
||||
}
|
||||
console.warn(err);
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
|
||||
index = i;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return index;
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
|
||||
if (!success) {
|
||||
return TPromise.wrapError('cannot open ' + uri.toString());
|
||||
}
|
||||
return undefined;
|
||||
}, err => {
|
||||
return TPromise.wrapError('cannot open ' + uri.toString() + '. Detail: ' + toErrorMessage(err));
|
||||
});
|
||||
@@ -225,6 +226,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
|
||||
const mode = this._modeService.getOrCreateModeByFilenameOrFirstLine(uri.fsPath, firstLineText);
|
||||
return this._modelService.createModel(value, mode, uri);
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -39,5 +39,6 @@ export class MainThreadStorage extends MainThreadStorageShape {
|
||||
} catch (err) {
|
||||
return TPromise.wrapError(err);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user