File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -654,8 +654,8 @@ class DefaultClient implements Client {
654654 // Recycle the active text decorations when we receive a new set of inactive regions
655655 let valuePair : DecorationRangesPair = this . inactiveRegionsDecorations . get ( params . uri ) ;
656656 if ( valuePair ) {
657- // The language server will send notifications regardless of whether the ranges have changed. Unfortunately we must check for changes ourselves
658- if ( ! this . isRangesEqual ( valuePair . ranges , params . ranges ) ) {
657+ // The language server will send notifications regardless of whether the ranges have changed
658+ if ( ! this . areRangesEqual ( valuePair . ranges , params . ranges ) ) {
659659 // Disposing of and resetting the decoration will undo previously applied text decorations
660660 valuePair . decoration . dispose ( ) ;
661661 valuePair . decoration = decoration ;
@@ -678,17 +678,15 @@ class DefaultClient implements Client {
678678 }
679679 }
680680
681- // Helper method to compare two ranges for equality
682- private isRangesEqual ( r1 : vscode . Range [ ] , r2 : vscode . Range [ ] ) : boolean {
681+ // Helper method to compare two ranges arrays for equality
682+ private areRangesEqual ( r1 : vscode . Range [ ] , r2 : vscode . Range [ ] ) : boolean {
683683 if ( r1 . length !== r2 . length ) {
684684 return false ;
685685 }
686686
687- for ( let e1 of r1 ) {
688- for ( let e2 of r2 ) {
689- if ( ! e1 . isEqual ( e2 ) ) {
690- return false ;
691- }
687+ for ( let i : number = 0 ; i < r1 . length ; ++ i ) {
688+ if ( ! r1 [ i ] . isEqual ( r2 [ i ] ) ) {
689+ return false ;
692690 }
693691 }
694692
You can’t perform that action at this time.
0 commit comments