@@ -1529,7 +1529,7 @@ module ts {
15291529 var filenames = host . getScriptFileNames ( ) ;
15301530 for ( var i = 0 , n = filenames . length ; i < n ; i ++ ) {
15311531 var filename = filenames [ i ] ;
1532- this . filenameToEntry [ switchToForwardSlashes ( filename ) ] = {
1532+ this . filenameToEntry [ normalizeSlashes ( filename ) ] = {
15331533 filename : filename ,
15341534 version : host . getScriptVersion ( filename ) ,
15351535 isOpen : host . getScriptIsOpen ( filename )
@@ -1544,7 +1544,7 @@ module ts {
15441544 }
15451545
15461546 public getEntry ( filename : string ) : HostFileInformation {
1547- filename = switchToForwardSlashes ( filename ) ;
1547+ filename = normalizeSlashes ( filename ) ;
15481548 return lookUp ( this . filenameToEntry , filename ) ;
15491549 }
15501550
@@ -2322,7 +2322,7 @@ module ts {
23222322 function getSyntacticDiagnostics ( filename : string ) {
23232323 synchronizeHostData ( ) ;
23242324
2325- filename = switchToForwardSlashes ( filename ) ;
2325+ filename = normalizeSlashes ( filename ) ;
23262326
23272327 return program . getDiagnostics ( getSourceFile ( filename ) . getSourceFile ( ) ) ;
23282328 }
@@ -2334,7 +2334,7 @@ module ts {
23342334 function getSemanticDiagnostics ( filename : string ) {
23352335 synchronizeHostData ( ) ;
23362336
2337- filename = switchToForwardSlashes ( filename )
2337+ filename = normalizeSlashes ( filename )
23382338 var compilerOptions = program . getCompilerOptions ( ) ;
23392339 var checker = getFullTypeCheckChecker ( ) ;
23402340 var targetSourceFile = getSourceFile ( filename ) ;
@@ -2415,7 +2415,7 @@ module ts {
24152415 function getCompletionsAtPosition ( filename : string , position : number , isMemberCompletion : boolean ) {
24162416 synchronizeHostData ( ) ;
24172417
2418- filename = switchToForwardSlashes ( filename ) ;
2418+ filename = normalizeSlashes ( filename ) ;
24192419
24202420 var syntacticStart = new Date ( ) . getTime ( ) ;
24212421 var sourceFile = getSourceFile ( filename ) ;
@@ -2760,7 +2760,7 @@ module ts {
27602760 function getCompletionEntryDetails ( filename : string , position : number , entryName : string ) : CompletionEntryDetails {
27612761 // Note: No need to call synchronizeHostData, as we have captured all the data we need
27622762 // in the getCompletionsAtPosition earlier
2763- filename = switchToForwardSlashes ( filename ) ;
2763+ filename = normalizeSlashes ( filename ) ;
27642764
27652765 var sourceFile = getSourceFile ( filename ) ;
27662766
@@ -3260,7 +3260,7 @@ module ts {
32603260 function getQuickInfoAtPosition ( fileName : string , position : number ) : QuickInfo {
32613261 synchronizeHostData ( ) ;
32623262
3263- fileName = switchToForwardSlashes ( fileName ) ;
3263+ fileName = normalizeSlashes ( fileName ) ;
32643264 var sourceFile = getSourceFile ( fileName ) ;
32653265 var node = getTouchingPropertyName ( sourceFile , position ) ;
32663266 if ( ! node ) {
@@ -3362,7 +3362,7 @@ module ts {
33623362
33633363 synchronizeHostData ( ) ;
33643364
3365- filename = switchToForwardSlashes ( filename ) ;
3365+ filename = normalizeSlashes ( filename ) ;
33663366 var sourceFile = getSourceFile ( filename ) ;
33673367
33683368 var node = getTouchingPropertyName ( sourceFile , position ) ;
@@ -3426,7 +3426,7 @@ module ts {
34263426 function getOccurrencesAtPosition ( filename : string , position : number ) : ReferenceEntry [ ] {
34273427 synchronizeHostData ( ) ;
34283428
3429- filename = switchToForwardSlashes ( filename ) ;
3429+ filename = normalizeSlashes ( filename ) ;
34303430 var sourceFile = getSourceFile ( filename ) ;
34313431
34323432 var node = getTouchingWord ( sourceFile , position ) ;
@@ -3876,7 +3876,7 @@ module ts {
38763876 function findReferences ( fileName : string , position : number , findInStrings : boolean , findInComments : boolean ) : ReferenceEntry [ ] {
38773877 synchronizeHostData ( ) ;
38783878
3879- fileName = switchToForwardSlashes ( fileName ) ;
3879+ fileName = normalizeSlashes ( fileName ) ;
38803880 var sourceFile = getSourceFile ( fileName ) ;
38813881
38823882 var node = getTouchingPropertyName ( sourceFile , position ) ;
@@ -4597,7 +4597,7 @@ module ts {
45974597
45984598 function getEmitOutput ( filename : string ) : EmitOutput {
45994599 synchronizeHostData ( ) ;
4600- filename = switchToForwardSlashes ( filename ) ;
4600+ filename = normalizeSlashes ( filename ) ;
46014601 var compilerOptions = program . getCompilerOptions ( ) ;
46024602 var targetSourceFile = program . getSourceFile ( filename ) ; // Current selected file to be output
46034603 // If --out flag is not specified, shouldEmitToOwnFile is true. Otherwise shouldEmitToOwnFile is false.
@@ -4771,7 +4771,7 @@ module ts {
47714771 function getSignatureHelpItems ( fileName : string , position : number ) : SignatureHelpItems {
47724772 synchronizeHostData ( ) ;
47734773
4774- fileName = switchToForwardSlashes ( fileName ) ;
4774+ fileName = normalizeSlashes ( fileName ) ;
47754775 var sourceFile = getSourceFile ( fileName ) ;
47764776
47774777 return SignatureHelp . getSignatureHelpItems ( sourceFile , position , typeInfoResolver , cancellationToken ) ;
@@ -4841,12 +4841,12 @@ module ts {
48414841
48424842 /// Syntactic features
48434843 function getSyntaxTree ( filename : string ) : TypeScript . SyntaxTree {
4844- filename = switchToForwardSlashes ( filename ) ;
4844+ filename = normalizeSlashes ( filename ) ;
48454845 return syntaxTreeCache . getCurrentFileSyntaxTree ( filename ) ;
48464846 }
48474847
48484848 function getCurrentSourceFile ( filename : string ) : SourceFile {
4849- filename = switchToForwardSlashes ( filename ) ;
4849+ filename = normalizeSlashes ( filename ) ;
48504850 var currentSourceFile = syntaxTreeCache . getCurrentSourceFile ( filename ) ;
48514851 return currentSourceFile ;
48524852 }
@@ -4913,14 +4913,14 @@ module ts {
49134913 }
49144914
49154915 function getNavigationBarItems ( filename : string ) : NavigationBarItem [ ] {
4916- filename = switchToForwardSlashes ( filename ) ;
4916+ filename = normalizeSlashes ( filename ) ;
49174917
49184918 return NavigationBar . getNavigationBarItems ( getCurrentSourceFile ( filename ) ) ;
49194919 }
49204920
49214921 function getSemanticClassifications ( fileName : string , span : TypeScript . TextSpan ) : ClassifiedSpan [ ] {
49224922 synchronizeHostData ( ) ;
4923- fileName = switchToForwardSlashes ( fileName ) ;
4923+ fileName = normalizeSlashes ( fileName ) ;
49244924
49254925 var sourceFile = getSourceFile ( fileName ) ;
49264926
@@ -4991,7 +4991,7 @@ module ts {
49914991
49924992 function getSyntacticClassifications ( fileName : string , span : TypeScript . TextSpan ) : ClassifiedSpan [ ] {
49934993 // doesn't use compiler - no need to synchronize with host
4994- fileName = switchToForwardSlashes ( fileName ) ;
4994+ fileName = normalizeSlashes ( fileName ) ;
49954995 var sourceFile = getCurrentSourceFile ( fileName ) ;
49964996
49974997 var result : ClassifiedSpan [ ] = [ ] ;
@@ -5121,7 +5121,7 @@ module ts {
51215121
51225122 function getOutliningSpans ( filename : string ) : OutliningSpan [ ] {
51235123 // doesn't use compiler - no need to synchronize with host
5124- filename = switchToForwardSlashes ( filename ) ;
5124+ filename = normalizeSlashes ( filename ) ;
51255125 var sourceFile = getCurrentSourceFile ( filename ) ;
51265126 return OutliningElementsCollector . collectElements ( sourceFile ) ;
51275127 }
@@ -5180,7 +5180,7 @@ module ts {
51805180 }
51815181
51825182 function getIndentationAtPosition ( filename : string , position : number , editorOptions : EditorOptions ) {
5183- filename = switchToForwardSlashes ( filename ) ;
5183+ filename = normalizeSlashes ( filename ) ;
51845184
51855185 var start = new Date ( ) . getTime ( ) ;
51865186 var sourceFile = getCurrentSourceFile ( filename ) ;
@@ -5217,21 +5217,21 @@ module ts {
52175217 }
52185218
52195219 function getFormattingEditsForRange ( fileName : string , start : number , end : number , options : FormatCodeOptions ) : TextChange [ ] {
5220- fileName = switchToForwardSlashes ( fileName ) ;
5220+ fileName = normalizeSlashes ( fileName ) ;
52215221
52225222 var manager = getFormattingManager ( fileName , options ) ;
52235223 return manager . formatSelection ( start , end ) ;
52245224 }
52255225
52265226 function getFormattingEditsForDocument ( fileName : string , options : FormatCodeOptions ) : TextChange [ ] {
5227- fileName = switchToForwardSlashes ( fileName ) ;
5227+ fileName = normalizeSlashes ( fileName ) ;
52285228
52295229 var manager = getFormattingManager ( fileName , options ) ;
52305230 return manager . formatDocument ( ) ;
52315231 }
52325232
52335233 function getFormattingEditsAfterKeystroke ( fileName : string , position : number , key : string , options : FormatCodeOptions ) : TextChange [ ] {
5234- fileName = switchToForwardSlashes ( fileName ) ;
5234+ fileName = normalizeSlashes ( fileName ) ;
52355235
52365236 var manager = getFormattingManager ( fileName , options ) ;
52375237
@@ -5257,7 +5257,7 @@ module ts {
52575257 // anything away.
52585258 synchronizeHostData ( ) ;
52595259
5260- filename = TypeScript . switchToForwardSlashes ( filename ) ;
5260+ filename = normalizeSlashes ( filename ) ;
52615261
52625262 var sourceFile = getSourceFile ( filename ) ;
52635263
@@ -5417,7 +5417,7 @@ module ts {
54175417 function getRenameInfo ( fileName : string , position : number ) : RenameInfo {
54185418 synchronizeHostData ( ) ;
54195419
5420- fileName = switchToForwardSlashes ( fileName ) ;
5420+ fileName = normalizeSlashes ( fileName ) ;
54215421 var sourceFile = getSourceFile ( fileName ) ;
54225422
54235423 var node = getTouchingWord ( sourceFile , position ) ;
0 commit comments