11//
22// Copyright (c) Microsoft Corporation. All rights reserved.
3- //
3+ //
44// Licensed under the Apache License, Version 2.0 (the "License");
55// you may not use this file except in compliance with the License.
66// You may obtain a copy of the License at
@@ -135,7 +135,7 @@ module FourSlash {
135135 var fileMetadataNames = [ metadataOptionNames . fileName , metadataOptionNames . emitThisFile , metadataOptionNames . resolveReference ] ;
136136 var globalMetadataNames = [ metadataOptionNames . allowNonTsExtensions , metadataOptionNames . baselineFile , metadataOptionNames . declaration ,
137137 metadataOptionNames . mapRoot , metadataOptionNames . module , metadataOptionNames . out ,
138- metadataOptionNames . outDir , metadataOptionNames . sourceMap , metadataOptionNames . sourceRoot ]
138+ metadataOptionNames . outDir , metadataOptionNames . sourceMap , metadataOptionNames . sourceRoot ] ;
139139
140140 function convertGlobalOptionsToCompilerOptions ( globalOptions : { [ idx : string ] : string } ) : ts . CompilerOptions {
141141 var settings : ts . CompilerOptions = { target : ts . ScriptTarget . ES5 } ;
@@ -192,7 +192,7 @@ module FourSlash {
192192
193193 export class TestCancellationToken implements ts . HostCancellationToken {
194194 // 0 - cancelled
195- // >0 - not cancelled
195+ // >0 - not cancelled
196196 // <0 - not cancelled and value denotes number of isCancellationRequested after which token become cancelled
197197 private static NotCanceled : number = - 1 ;
198198 private numberOfCallsBeforeCancellation : number = TestCancellationToken . NotCanceled ;
@@ -271,7 +271,7 @@ module FourSlash {
271271 private taoInvalidReason : string = null ;
272272
273273 private inputFiles : ts . Map < string > = { } ; // Map between inputFile's fileName and its content for easily looking up when resolving references
274-
274+
275275 // Add input file which has matched file name with the given reference-file path.
276276 // This is necessary when resolveReference flag is specified
277277 private addMatchedInputFile ( referenceFilePath : string ) {
@@ -426,7 +426,7 @@ module FourSlash {
426426 this . activeFile = fileToOpen ;
427427 var fileName = fileToOpen . fileName . replace ( Harness . IO . directoryName ( fileToOpen . fileName ) , '' ) . substr ( 1 ) ;
428428 this . scenarioActions . push ( '<OpenFile FileName="" SrcFileId="' + fileName + '" FileId="' + fileName + '" />' ) ;
429-
429+
430430 // Let the host know that this file is now open
431431 this . languageServiceAdapterHost . openFile ( fileToOpen . fileName ) ;
432432 }
@@ -755,7 +755,7 @@ module FourSlash {
755755 error += "Expected documentation: " + expectedDocumentation + " to equal: " + ts . displayPartsToString ( details . documentation ) + "." ;
756756 }
757757 if ( expectedKind ) {
758- error += "Expected kind: " + expectedKind + " to equal: " + filterCompletions [ 0 ] . kind + "."
758+ error += "Expected kind: " + expectedKind + " to equal: " + filterCompletions [ 0 ] . kind + "." ;
759759 }
760760 this . raiseError ( error ) ;
761761 }
@@ -1151,6 +1151,7 @@ module FourSlash {
11511151 var length : number ;
11521152 var prefixString = " >" ;
11531153
1154+ var pos = 0 ;
11541155 var addSpanInfoString = ( ) => {
11551156 if ( previousSpanInfo ) {
11561157 resultString += currentLine ;
@@ -1163,7 +1164,7 @@ module FourSlash {
11631164 }
11641165 } ;
11651166
1166- for ( var pos = 0 ; pos < this . activeFile . content . length ; pos ++ ) {
1167+ for ( pos < this . activeFile . content . length ; pos ++ ) {
11671168 if ( pos === 0 || pos === fileLineMap [ nextLine ] ) {
11681169 nextLine ++ ;
11691170 addSpanInfoString ( ) ;
@@ -1347,7 +1348,7 @@ module FourSlash {
13471348 var offset = this . currentCaretPosition ;
13481349 var ch = "" ;
13491350
1350- var checkCadence = ( count >> 2 ) + 1
1351+ var checkCadence = ( count >> 2 ) + 1 ;
13511352
13521353 for ( var i = 0 ; i < count ; i ++ ) {
13531354 // Make the edit
@@ -1363,7 +1364,7 @@ module FourSlash {
13631364 var edits = this . languageService . getFormattingEditsAfterKeystroke ( this . activeFile . fileName , offset , ch , this . formatCodeOptions ) ;
13641365 if ( edits . length ) {
13651366 offset += this . applyEdits ( this . activeFile . fileName , edits , true ) ;
1366- //this.checkPostEditInvariants();
1367+ // this.checkPostEditInvariants();
13671368 }
13681369 }
13691370 }
@@ -1388,7 +1389,7 @@ module FourSlash {
13881389
13891390 var offset = this . currentCaretPosition ;
13901391 var ch = "" ;
1391- var checkCadence = ( count >> 2 ) + 1
1392+ var checkCadence = ( count >> 2 ) + 1 ;
13921393
13931394 for ( var i = 0 ; i < count ; i ++ ) {
13941395 offset -- ;
@@ -1503,8 +1504,8 @@ module FourSlash {
15031504 }
15041505
15051506 private checkPostEditInvariants ( ) {
1506- if ( this . testType !== FourSlashTestType . Native ) {
1507- // getSourcefile() results can not be serialized. Only perform these verifications
1507+ if ( this . testType !== FourSlashTestType . Native ) {
1508+ // getSourcefile() results can not be serialized. Only perform these verifications
15081509 // if running against a native LS object.
15091510 return ;
15101511 }
@@ -1883,7 +1884,7 @@ module FourSlash {
18831884 assert . equal (
18841885 expected . join ( "," ) ,
18851886 actual . fileNameList . map ( file => {
1886- return file . replace ( this . basePath + "/" , "" )
1887+ return file . replace ( this . basePath + "/" , "" ) ;
18871888 } ) . join ( "," )
18881889 ) ;
18891890 }
@@ -2156,7 +2157,7 @@ module FourSlash {
21562157
21572158 // Get the text of the entire line the caret is currently at
21582159 private getCurrentLineContent ( ) {
2159- var text = this . getFileContent ( this . activeFile . fileName )
2160+ var text = this . getFileContent ( this . activeFile . fileName ) ;
21602161
21612162 var pos = this . currentCaretPosition ;
21622163 var startPos = pos , endPos = pos ;
@@ -2286,7 +2287,7 @@ module FourSlash {
22862287 }
22872288
22882289 public setCancelled ( numberOfCalls : number ) : void {
2289- this . cancellationToken . setCancelled ( numberOfCalls )
2290+ this . cancellationToken . setCancelled ( numberOfCalls ) ;
22902291 }
22912292
22922293 public resetCancelled ( ) : void {
0 commit comments