Merge pull request #15797 from joaomoreno/reference-counted-models

Reference counted (workbench) text models
This commit is contained in:
João Moreno
2016-11-22 11:05:50 +01:00
committed by GitHub
24 changed files with 420 additions and 284 deletions

View File

@@ -187,8 +187,11 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
}
private _handleAsResourceInput(uri: URI): TPromise<boolean> {
return this._textModelResolverService.resolve(uri).then(model => {
return !!model;
return this._textModelResolverService.createModelReference(uri).then(ref => {
const result = !!ref.object;
ref.dispose();
return result;
});
}