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 {
654
654
// Recycle the active text decorations when we receive a new set of inactive regions
655
655
let valuePair : DecorationRangesPair = this . inactiveRegionsDecorations . get ( params . uri ) ;
656
656
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 ) ) {
659
659
// Disposing of and resetting the decoration will undo previously applied text decorations
660
660
valuePair . decoration . dispose ( ) ;
661
661
valuePair . decoration = decoration ;
@@ -678,17 +678,15 @@ class DefaultClient implements Client {
678
678
}
679
679
}
680
680
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 {
683
683
if ( r1 . length !== r2 . length ) {
684
684
return false ;
685
685
}
686
686
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 ;
692
690
}
693
691
}
694
692
You can’t perform that action at this time.
0 commit comments