Remove unnecessary LS code.

This commit is contained in:
Cyrus Najmabadi 2014-08-16 16:07:55 -07:00
parent 87ebb6b2da
commit bc71ef009e
4 changed files with 2 additions and 47 deletions

View File

@ -17,31 +17,11 @@
module TypeScript {
export interface Logger {
information(): boolean;
debug(): boolean;
warning(): boolean;
error(): boolean;
fatal(): boolean;
log(s: string): void;
}
export class NullLogger implements Logger {
public information(): boolean { return false; }
public debug(): boolean { return false; }
public warning(): boolean { return false; }
public error(): boolean { return false; }
public fatal(): boolean { return false; }
public log(s: string): void {
}
}
export function timeFunction(logger: Logger, funcDescription: string, func: () => any): any {
var start = (new Date()).getTime();
var result = func();
var end = (new Date()).getTime();
if (logger.information()) {
logger.log(funcDescription + " completed in " + (end - start) + " msec");
}
return result;
}
}

View File

@ -40,8 +40,8 @@ module TypeScript.Services.Formatting {
public ensureUpToDate(options: ts.FormatCodeOptions) {
if (this.options == null || !ts.compareDataObjects(this.options, options)) {
var activeRules: Rule[] = TypeScript.timeFunction(this.logger, "RulesProvider: createActiveRules()", () => { return this.createActiveRules(options); });
var rulesMap: RulesMap = TypeScript.timeFunction(this.logger, "RulesProvider: RulesMap.create()", () => { return RulesMap.create(activeRules); });
var activeRules = this.createActiveRules(options);
var rulesMap = RulesMap.create(activeRules);
this.activeRules = activeRules;
this.rulesMap = rulesMap;

View File

@ -432,11 +432,6 @@ module ts {
}
export interface Logger {
information(): boolean;
debug(): boolean;
warning(): boolean;
error(): boolean;
fatal(): boolean;
log(s: string): void;
}

View File

@ -307,26 +307,6 @@ module ts {
constructor(private shimHost: LanguageServiceShimHost) {
}
public information(): boolean {
return this.shimHost.information();
}
public debug(): boolean {
return this.shimHost.debug();
}
public warning(): boolean {
return this.shimHost.warning();
}
public error(): boolean {
return this.shimHost.error();
}
public fatal(): boolean {
return this.shimHost.fatal();
}
public log(s: string): void {
this.shimHost.log(s);
}