mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 14:34:35 -06:00
Remove unnecessary LS code.
This commit is contained in:
parent
87ebb6b2da
commit
bc71ef009e
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
@ -432,11 +432,6 @@ module ts {
|
||||
}
|
||||
|
||||
export interface Logger {
|
||||
information(): boolean;
|
||||
debug(): boolean;
|
||||
warning(): boolean;
|
||||
error(): boolean;
|
||||
fatal(): boolean;
|
||||
log(s: string): void;
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user