提交 a4e13a9a 编写于 作者: J Johannes Rieken

debt - remove validation participants

上级 c9c8b0f6
......@@ -22,13 +22,6 @@ export interface IWorkerParticipant {
}
export interface IValidateParticipant extends IWorkerParticipant {
/**
* @param context mode specific data that helps with validation.
*/
validate(mirrorModel:EditorCommon.IMirrorModel, markerService:IMarkerService, context:any):void;
}
export interface ISuggestParticipant extends IWorkerParticipant {
filter?:(word:string, suggestion:ISuggestion) => IMatch[];
suggest?:(resource:URI, position:EditorCommon.IPosition, context?:any) => TPromise<ISuggestResult>;
......
......@@ -18,10 +18,6 @@ import EditorCommon = require('vs/editor/common/editorCommon');
import Modes = require('vs/editor/common/modes');
import {TPromise} from 'vs/base/common/winjs.base';
function isIValidateParticipant(thing:any):boolean {
return typeof (<Modes.IValidateParticipant> thing).validate === 'function';
}
function isISuggestParticipant(thing:any):boolean {
return typeof (<Modes.ISuggestParticipant> thing).suggest === 'function' || typeof (<Modes.ISuggestParticipant> thing).filter === 'function';
}
......@@ -30,7 +26,6 @@ export class AbstractModeWorker {
static filter: Modes.ISuggestionFilter = DefaultFilter;
private _validationParticipants:Modes.IValidateParticipant[] = [];
private _suggestParticipants:Modes.ISuggestParticipant[] = [];
private _participants:Modes.IWorkerParticipant[] = [];
......@@ -59,7 +54,6 @@ export class AbstractModeWorker {
);
// add contributed participants
this._validationParticipants = this._getWorkerParticipants<Modes.IValidateParticipant>(p => isIValidateParticipant(p));
this._suggestParticipants = this._getWorkerParticipants<Modes.ISuggestParticipant>(p => isISuggestParticipant(p));
this.inplaceReplaceSupport = this._createInPlaceReplaceSupport();
......@@ -90,9 +84,6 @@ export class AbstractModeWorker {
private _newValidate(changed:URI[], notChanged:URI[], dueToConfigurationChange:boolean): void {
this.doValidateOnChange(changed, notChanged, dueToConfigurationChange);
for (var i = 0; i < changed.length; i++) {
this.triggerValidateParticipation(changed[i], this._getContextForValidationParticipants(changed[i]));
}
}
public _getContextForValidationParticipants(resource:URI):any {
......@@ -114,19 +105,6 @@ export class AbstractModeWorker {
}
}
public triggerValidateParticipation(resource:URI, context:any=null):void {
var model = this.resourceService.get(resource);
this._validationParticipants.forEach(participant => {
try {
participant.validate(model, this.markerService, context);
} catch(e) {
/// We should install a watch dog here. If a participant fails
/// too often we should shut the participant down.
}
});
}
public doValidate(resource:URI): void {
return null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册