@@ -963,7 +963,7 @@ export class TestState {
963963
964964 const fileName = this . activeFile . fileName ;
965965 const hints = this . languageService . provideInlayHints ( fileName , span , preferences ) ;
966- const annotations = ts . map ( hints . sort ( sortHints ) , hint => {
966+ const annotations = ts . map ( hints . slice ( ) . sort ( sortHints ) , hint => {
967967 if ( hint . displayParts ) {
968968 hint . displayParts = ts . map ( hint . displayParts , part => {
969969 if ( part . file && / l i b .* \. d \. t s $ / . test ( part . file ) ) {
@@ -3257,8 +3257,8 @@ export class TestState {
32573257 allSpanInsets . push ( { text : "|]" , pos : span . textSpan . start + span . textSpan . length } ) ;
32583258 } ) ;
32593259
3260- const reverseSpans = allSpanInsets . sort ( ( l , r ) => r . pos - l . pos ) ;
3261- ts . forEach ( reverseSpans , span => {
3260+ allSpanInsets . sort ( ( l , r ) => r . pos - l . pos ) ;
3261+ ts . forEach ( allSpanInsets , span => {
32623262 annotated = annotated . slice ( 0 , span . pos ) + span . text + annotated . slice ( span . pos ) ;
32633263 } ) ;
32643264 Harness . IO . log ( `\nMockup:\n${ annotated } ` ) ;
@@ -3783,7 +3783,7 @@ export class TestState {
37833783 return { baselineContent : baselineContent + activeFile . content + `\n\n--No linked edits found--` , offset } ;
37843784 }
37853785
3786- let inlineLinkedEditBaselines : { start : number ; end : number ; index : number ; } [ ] = [ ] ;
3786+ const inlineLinkedEditBaselines : { start : number ; end : number ; index : number ; } [ ] = [ ] ;
37873787 let linkedEditInfoBaseline = "" ;
37883788 for ( const edit of linkedEditsByRange ) {
37893789 const [ linkedEdit , positions ] = edit ;
@@ -3802,7 +3802,7 @@ export class TestState {
38023802 offset ++ ;
38033803 }
38043804
3805- inlineLinkedEditBaselines = inlineLinkedEditBaselines . sort ( ( a , b ) => a . start - b . start ) ;
3805+ inlineLinkedEditBaselines . sort ( ( a , b ) => a . start - b . start ) ;
38063806 const fileText = activeFile . content ;
38073807 baselineContent += fileText . slice ( 0 , inlineLinkedEditBaselines [ 0 ] . start ) ;
38083808 for ( let i = 0 ; i < inlineLinkedEditBaselines . length ; i ++ ) {
@@ -4058,7 +4058,7 @@ export class TestState {
40584058 public verifyRefactorKindsAvailable ( kind : string , expected : string [ ] , preferences = ts . emptyOptions ) {
40594059 const refactors = this . getApplicableRefactorsAtSelection ( "invoked" , kind , preferences ) ;
40604060 const availableKinds = ts . flatMap ( refactors , refactor => refactor . actions ) . map ( action => action . kind ) ;
4061- assert . deepEqual ( availableKinds . sort ( ) , expected . sort ( ) , `Expected kinds to be equal` ) ;
4061+ assert . deepEqual ( availableKinds . slice ( ) . sort ( ) , expected . slice ( ) . sort ( ) , `Expected kinds to be equal` ) ;
40624062 }
40634063
40644064 public verifyRefactorsAvailable ( names : readonly string [ ] ) : void {
@@ -4938,7 +4938,7 @@ function parseFileContent(content: string, fileName: string, markerMap: Map<stri
49384938 const openRanges : RangeLocationInformation [ ] = [ ] ;
49394939
49404940 /// A list of ranges we've collected so far */
4941- let localRanges : Range [ ] = [ ] ;
4941+ const localRanges : Range [ ] = [ ] ;
49424942
49434943 /// The latest position of the start of an unflushed plain text area
49444944 let lastNormalCharPosition = 0 ;
@@ -5105,7 +5105,7 @@ function parseFileContent(content: string, fileName: string, markerMap: Map<stri
51055105 }
51065106
51075107 // put ranges in the correct order
5108- localRanges = localRanges . sort ( ( a , b ) => a . pos < b . pos ? - 1 : a . pos === b . pos && a . end > b . end ? - 1 : 1 ) ;
5108+ localRanges . sort ( ( a , b ) => a . pos < b . pos ? - 1 : a . pos === b . pos && a . end > b . end ? - 1 : 1 ) ;
51095109 localRanges . forEach ( r => ranges . push ( r ) ) ;
51105110
51115111 return {
0 commit comments