File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import * as ts from "typescript";
3
3
import { createDefaultFormatCodeSettings } from "./utils" ;
4
4
5
5
class LanguageServiceHost implements ts . LanguageServiceHost {
6
- files : { [ fileName : string ] : ts . IScriptSnapshot ; } = { } ;
6
+ files : ts . MapLike < ts . IScriptSnapshot > = { } ;
7
7
addFile ( fileName : string , text : string ) {
8
8
this . files [ fileName ] = ts . ScriptSnapshot . fromString ( text ) ;
9
9
}
@@ -12,10 +12,10 @@ class LanguageServiceHost implements ts.LanguageServiceHost {
12
12
13
13
getCompilationSettings = ( ) => ts . getDefaultCompilerOptions ( ) ;
14
14
getScriptFileNames = ( ) => Object . keys ( this . files ) ;
15
- getScriptVersion = ( _fileName : string ) => "1 " ;
15
+ getScriptVersion = ( _fileName : string ) => "0 " ;
16
16
getScriptSnapshot = ( fileName : string ) => this . files [ fileName ] ;
17
17
getCurrentDirectory = ( ) => process . cwd ( ) ;
18
- getDefaultLibFileName = ( _options : ts . CompilerOptions ) => "lib" ;
18
+ getDefaultLibFileName = ( options : ts . CompilerOptions ) => ts . getDefaultLibFilePath ( options ) ;
19
19
}
20
20
21
21
export function format ( fileName : string , text : string , options = createDefaultFormatCodeSettings ( ) ) {
You can’t perform that action at this time.
0 commit comments