@@ -20,13 +20,18 @@ import { ScopeRangeProvider } from "./ScopeRangeProvider";
2020 */
2121export class ScopeRangeWatcher {
2222 private disposables : Disposable [ ] = [ ] ;
23- private debouncer = new Debouncer ( ( ) => this . onChange ( ) ) ;
23+ private debouncer = new Debouncer ( ( ) => this . onChange ) ;
2424 private listeners : ( ( ) => void ) [ ] = [ ] ;
2525
2626 constructor (
2727 languageDefinitions : LanguageDefinitions ,
2828 private scopeRangeProvider : ScopeRangeProvider ,
2929 ) {
30+ this . onChange = this . onChange . bind ( this ) ;
31+ this . onDidChangeScopeRanges = this . onDidChangeScopeRanges . bind ( this ) ;
32+ this . onDidChangeIterationScopeRanges =
33+ this . onDidChangeIterationScopeRanges . bind ( this ) ;
34+
3035 this . disposables . push (
3136 // An Event which fires when the array of visible editors has changed.
3237 ide ( ) . onDidChangeVisibleTextEditors ( this . debouncer . run ) ,
@@ -39,13 +44,9 @@ export class ScopeRangeWatcher {
3944 // dirty-state changes.
4045 ide ( ) . onDidChangeTextDocument ( this . debouncer . run ) ,
4146 ide ( ) . onDidChangeTextEditorVisibleRanges ( this . debouncer . run ) ,
42- languageDefinitions . onDidChangeDefinition ( this . debouncer . run ) ,
47+ languageDefinitions . onDidChangeDefinition ( this . onChange ) ,
4348 this . debouncer ,
4449 ) ;
45-
46- this . onDidChangeScopeRanges = this . onDidChangeScopeRanges . bind ( this ) ;
47- this . onDidChangeIterationScopeRanges =
48- this . onDidChangeIterationScopeRanges . bind ( this ) ;
4950 }
5051
5152 /**
0 commit comments