@@ -108,7 +108,7 @@ namespace ts.server {
108
108
export interface HostConfiguration {
109
109
formatCodeOptions : FormatCodeSettings ;
110
110
hostInfo : string ;
111
- fileExtensionMap ?: FileExtensionMapItem [ ] ;
111
+ extraFileExtensions ?: FileExtensionInfo [ ] ;
112
112
}
113
113
114
114
interface ConfigFileConversionResult {
@@ -133,14 +133,14 @@ namespace ts.server {
133
133
interface FilePropertyReader < T > {
134
134
getFileName ( f : T ) : string ;
135
135
getScriptKind ( f : T ) : ScriptKind ;
136
- hasMixedContent ( f : T , fileExtensionMap : FileExtensionMapItem [ ] ) : boolean ;
136
+ hasMixedContent ( f : T , extraFileExtensions : FileExtensionInfo [ ] ) : boolean ;
137
137
}
138
138
139
139
const fileNamePropertyReader : FilePropertyReader < string > = {
140
140
getFileName : x => x ,
141
141
getScriptKind : _ => undefined ,
142
- hasMixedContent : ( fileName , fileExtensionMap ) => {
143
- const mixedContentExtensions = ts . map ( ts . filter ( fileExtensionMap , item => item . isMixedContent ) , item => item . extension ) ;
142
+ hasMixedContent : ( fileName , extraFileExtensions ) => {
143
+ const mixedContentExtensions = ts . map ( ts . filter ( extraFileExtensions , item => item . isMixedContent ) , item => item . extension ) ;
144
144
return forEach ( mixedContentExtensions , extension => fileExtensionIs ( fileName , extension ) )
145
145
}
146
146
} ;
@@ -287,7 +287,7 @@ namespace ts.server {
287
287
this . hostConfiguration = {
288
288
formatCodeOptions : getDefaultFormatCodeSettings ( this . host ) ,
289
289
hostInfo : "Unknown host" ,
290
- fileExtensionMap : [ ]
290
+ extraFileExtensions : [ ]
291
291
} ;
292
292
293
293
this . documentRegistry = createDocumentRegistry ( host . useCaseSensitiveFileNames , host . getCurrentDirectory ( ) ) ;
@@ -491,7 +491,7 @@ namespace ts.server {
491
491
// If a change was made inside "folder/file", node will trigger the callback twice:
492
492
// one with the fileName being "folder/file", and the other one with "folder".
493
493
// We don't respond to the second one.
494
- if ( fileName && ! ts . isSupportedSourceFileName ( fileName , project . getCompilerOptions ( ) , this . hostConfiguration . fileExtensionMap ) ) {
494
+ if ( fileName && ! ts . isSupportedSourceFileName ( fileName , project . getCompilerOptions ( ) , this . hostConfiguration . extraFileExtensions ) ) {
495
495
return ;
496
496
}
497
497
@@ -820,7 +820,7 @@ namespace ts.server {
820
820
/*existingOptions*/ { } ,
821
821
configFilename ,
822
822
/*resolutionStack*/ [ ] ,
823
- this . hostConfiguration . fileExtensionMap ) ;
823
+ this . hostConfiguration . extraFileExtensions ) ;
824
824
825
825
if ( parsedCommandLine . errors . length ) {
826
826
errors = concatenate ( errors , parsedCommandLine . errors ) ;
@@ -924,7 +924,7 @@ namespace ts.server {
924
924
for ( const f of files ) {
925
925
const rootFilename = propertyReader . getFileName ( f ) ;
926
926
const scriptKind = propertyReader . getScriptKind ( f ) ;
927
- const hasMixedContent = propertyReader . hasMixedContent ( f , this . hostConfiguration . fileExtensionMap ) ;
927
+ const hasMixedContent = propertyReader . hasMixedContent ( f , this . hostConfiguration . extraFileExtensions ) ;
928
928
if ( this . host . fileExists ( rootFilename ) ) {
929
929
const info = this . getOrCreateScriptInfoForNormalizedPath ( toNormalizedPath ( rootFilename ) , /*openedByClient*/ clientFileName == rootFilename , /*fileContent*/ undefined , scriptKind , hasMixedContent ) ;
930
930
project . addRoot ( info ) ;
@@ -970,7 +970,7 @@ namespace ts.server {
970
970
rootFilesChanged = true ;
971
971
if ( ! scriptInfo ) {
972
972
const scriptKind = propertyReader . getScriptKind ( f ) ;
973
- const hasMixedContent = propertyReader . hasMixedContent ( f , this . hostConfiguration . fileExtensionMap ) ;
973
+ const hasMixedContent = propertyReader . hasMixedContent ( f , this . hostConfiguration . extraFileExtensions ) ;
974
974
scriptInfo = this . getOrCreateScriptInfoForNormalizedPath ( normalizedPath , /*openedByClient*/ false , /*fileContent*/ undefined , scriptKind , hasMixedContent ) ;
975
975
}
976
976
}
@@ -1157,8 +1157,8 @@ namespace ts.server {
1157
1157
mergeMaps ( this . hostConfiguration . formatCodeOptions , convertFormatOptions ( args . formatOptions ) ) ;
1158
1158
this . logger . info ( "Format host information updated" ) ;
1159
1159
}
1160
- if ( args . fileExtensionMap ) {
1161
- this . hostConfiguration . fileExtensionMap = args . fileExtensionMap ;
1160
+ if ( args . extraFileExtensions ) {
1161
+ this . hostConfiguration . extraFileExtensions = args . extraFileExtensions ;
1162
1162
this . logger . info ( "Host file extension mappings updated" ) ;
1163
1163
}
1164
1164
}
0 commit comments