本文整理匯總了TypeScript中vs/editor/common/services/modelService.IModelService.onModelRemoved方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IModelService.onModelRemoved方法的具體用法?TypeScript IModelService.onModelRemoved怎麽用?TypeScript IModelService.onModelRemoved使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/services/modelService.IModelService
的用法示例。
在下文中一共展示了IModelService.onModelRemoved方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(problemMatchers: ProblemMatcher[], protected markerService: IMarkerService, private modelService: IModelService) {
this.matchers = Object.create(null);
this.bufferLength = 1;
problemMatchers.map(elem => createLineMatcher(elem)).forEach((matcher) => {
let length = matcher.matchLength;
if (length > this.bufferLength) {
this.bufferLength = length;
}
let value = this.matchers[length];
if (!value) {
value = [];
this.matchers[length] = value;
}
value.push(matcher);
});
this.buffer = [];
this.activeMatcher = null;
this._numberOfMatches = 0;
this._maxMarkerSeverity = undefined;
this.openModels = Object.create(null);
this.modelListeners = [];
this.applyToByOwner = new Map<string, ApplyToKind>();
for (let problemMatcher of problemMatchers) {
let current = this.applyToByOwner.get(problemMatcher.owner);
if (current === void 0) {
this.applyToByOwner.set(problemMatcher.owner, problemMatcher.applyTo);
} else {
this.applyToByOwner.set(problemMatcher.owner, this.mergeApplyTo(current, problemMatcher.applyTo));
}
}
this.resourcesToClean = new Map<string, Map<string, URI>>();
this.markers = new Map<string, Map<string, Map<string, IMarkerData>>>();
this.deliveredMarkers = new Map<string, Map<string, number>>();
this.modelService.onModelAdded((model) => {
this.openModels[model.uri.toString()] = true;
}, this, this.modelListeners);
this.modelService.onModelRemoved((model) => {
delete this.openModels[model.uri.toString()];
}, this, this.modelListeners);
this.modelService.getModels().forEach(model => this.openModels[model.uri.toString()] = true);
this._onDidStateChange = new Emitter();
}