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