1
1
import { IFileLoader } from "@wessberg/fileloader" ;
2
2
import { IMarshaller } from "@wessberg/marshaller" ;
3
- import * as ts from "typescript" ;
3
+ import * as typescript from "typescript" ;
4
4
import { ArrowFunction , BinaryExpression , CallExpression , ClassDeclaration , CompilerOptions , Declaration , ExportAssignment , ExportDeclaration , Expression , ExpressionStatement , FunctionDeclaration , ImportDeclaration , ImportEqualsDeclaration , IScriptSnapshot , LanguageService , ModuleKind , Node , NodeArray , ScriptTarget , Statement , SyntaxKind , VariableStatement } from "typescript" ;
5
5
import { Cache } from "../cache/Cache" ;
6
6
import { ICache } from "../cache/interface/ICache" ;
@@ -125,9 +125,8 @@ export class CodeAnalyzer implements ICodeAnalyzer {
125
125
private typeUtil : ITypeUtil ;
126
126
private files : Map < string , { version : number , content : string } > = new Map ( ) ;
127
127
constructor ( private marshaller : IMarshaller ,
128
- private fileLoader : IFileLoader ,
129
- public typescript : typeof ts = ts ) {
130
- this . languageService = this . typescript . createLanguageService ( this , typescript . createDocumentRegistry ( ) ) ;
128
+ private fileLoader : IFileLoader ) {
129
+ this . languageService = typescript . createLanguageService ( this , typescript . createDocumentRegistry ( ) ) ;
131
130
this . typeUtil = new TypeUtil ( ) ;
132
131
this . tokenSerializer = new TokenSerializer ( ) ;
133
132
this . tokenPredicator = new TokenPredicator ( ) ;
@@ -260,7 +259,7 @@ export class CodeAnalyzer implements ICodeAnalyzer {
260
259
public getScriptSnapshot ( fileName : string ) : IScriptSnapshot | undefined {
261
260
const file = this . files . get ( fileName ) ;
262
261
if ( file == null ) return undefined ;
263
- return this . typescript . ScriptSnapshot . fromString ( file . content ) ;
262
+ return typescript . ScriptSnapshot . fromString ( file . content ) ;
264
263
}
265
264
266
265
/**
@@ -277,7 +276,7 @@ export class CodeAnalyzer implements ICodeAnalyzer {
277
276
* @returns {string }
278
277
*/
279
278
public getDefaultLibFileName ( options : CompilerOptions ) : string {
280
- return this . typescript . getDefaultLibFilePath ( options ) ;
279
+ return typescript . getDefaultLibFilePath ( options ) ;
281
280
}
282
281
283
282
/**
0 commit comments