@@ -78,7 +78,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
7878 let lastUri : vscode . Uri | undefined ;
7979
8080 // ensure stable-sort
81- mergeSort ( first , DiagnosticCollection . _compareIndexedTuplesByUri ) ;
81+ first = mergeSort ( [ ... first ] , DiagnosticCollection . _compareIndexedTuplesByUri ) ;
8282
8383 for ( const tuple of first ) {
8484 const [ uri , diagnostics ] = tuple ;
@@ -88,17 +88,17 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
8888 }
8989 lastUri = uri ;
9090 toSync . push ( uri ) ;
91- this . _data . set ( uri . toString ( ) , [ ] ) ;
91+ this . _data . set ( uri , [ ] ) ;
9292 }
9393
9494 if ( ! diagnostics ) {
9595 // [Uri, undefined] means clear this
96- const currentDiagnostics = this . _data . get ( uri . toString ( ) ) ;
96+ const currentDiagnostics = this . _data . get ( uri ) ;
9797 if ( currentDiagnostics ) {
9898 currentDiagnostics . length = 0 ;
9999 }
100100 } else {
101- const currentDiagnostics = this . _data . get ( uri . toString ( ) ) ;
101+ const currentDiagnostics = this . _data . get ( uri ) ;
102102 if ( currentDiagnostics ) {
103103 currentDiagnostics . push ( ...diagnostics ) ;
104104 }
@@ -198,7 +198,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
198198 }
199199 }
200200
201- private static _compareIndexedTuplesByUri ( a : [ vscode . Uri , vscode . Diagnostic [ ] ] , b : [ vscode . Uri , vscode . Diagnostic [ ] ] ) : number {
201+ private static _compareIndexedTuplesByUri ( a : [ vscode . Uri , readonly vscode . Diagnostic [ ] ] , b : [ vscode . Uri , readonly vscode . Diagnostic [ ] ] ) : number {
202202 if ( a [ 0 ] . toString ( ) < b [ 0 ] . toString ( ) ) {
203203 return - 1 ;
204204 } else if ( a [ 0 ] . toString ( ) > b [ 0 ] . toString ( ) ) {
0 commit comments