mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
unwrap reference of promise
This commit is contained in:
@@ -187,12 +187,9 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
|
||||
}
|
||||
|
||||
private _handleAsResourceInput(uri: URI): TPromise<boolean> {
|
||||
const modelReference = this._textModelResolverService.getModelReference(uri);
|
||||
const modelPromise = modelReference.object;
|
||||
|
||||
return modelPromise.then(model => {
|
||||
const result = !!model;
|
||||
modelReference.dispose();
|
||||
return this._textModelResolverService.getModelReference(uri).then(ref => {
|
||||
const result = !!ref.object;
|
||||
ref.dispose();
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user