File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,11 +24,11 @@ import {
2424 IUnitTestSettings ,
2525 IWorkspaceSymbolSettings
2626} from './types' ;
27+ import { debounce } from './utils/decorators' ;
2728import { SystemVariables } from './variables/systemVariables' ;
2829
2930// tslint:disable:no-require-imports no-var-requires
3031const untildify = require ( 'untildify' ) ;
31- const _debounce = require ( 'lodash/debounce' ) as typeof import ( 'lodash/debounce' ) ;
3232
3333export class PythonSettings extends EventEmitter implements IPythonSettings {
3434 private static pythonSettings : Map < string , PythonSettings > = new Map < string , PythonSettings > ( ) ;
@@ -377,7 +377,7 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
377377
378378 // If workspace config changes, then we could have a cascading effect of on change events.
379379 // Let's defer the change notification.
380- _debounce ( ( ) => this . emit ( 'change' ) , 1 ) ;
380+ this . debounceChangeNotification ( ) ;
381381 } ;
382382 this . disposables . push ( this . InterpreterAutoSelectionService . onDidChangeAutoSelectedInterpreter ( onDidChange . bind ( this ) ) ) ;
383383 this . disposables . push ( this . workspace . onDidChangeConfiguration ( ( event : ConfigurationChangeEvent ) => {
@@ -391,6 +391,10 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
391391 this . update ( initialConfig ) ;
392392 }
393393 }
394+ @debounce ( 1 )
395+ protected debounceChangeNotification ( ) {
396+ this . emit ( 'change' ) ;
397+ }
394398}
395399
396400function getAbsolutePath ( pathToCheck : string , rootDir : string ) : string {
You can’t perform that action at this time.
0 commit comments