From e15f9349f9b4237c336a8c50d8b188f94fb22af0 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 22 Jan 2015 11:10:12 -0800 Subject: [PATCH] moved all methods of SourceFile to the part exposed on the services layer --- src/services/services.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 1b94899a1f5..55aa3d7b7cc 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -64,6 +64,8 @@ module ts { getLineAndCharacterFromPosition(pos: number): LineAndCharacter; getLineStarts(): number[]; getPositionFromLineAndCharacter(line: number, character: number): number; + getSyntacticDiagnostics(): Diagnostic[]; + update(newText: string, textChangeRange: TextChangeRange): SourceFile; } /** @@ -729,10 +731,6 @@ module ts { public statements: NodeArray; public endOfFileToken: Node; - // These methods will have their implementation provided by the implementation the - // compiler actually exports off of SourceFile. - public update: (newText: string, textChangeRange: TextChangeRange) => SourceFile; - public amdDependencies: string[]; public amdModuleName: string; public referencedFiles: FileReference[]; @@ -754,6 +752,14 @@ module ts { private namedDeclarations: Declaration[]; + public getSyntacticDiagnostics(): Diagnostic[]{ + return getSyntacticDiagnostics(this); + } + + public update(newText: string, textChangeRange: TextChangeRange): SourceFile { + return updateSourceFile(this, newText, textChangeRange); + } + public getLineAndCharacterFromPosition(position: number): LineAndCharacter { return getLineAndCharacterOfPosition(this, position); }