@@ -35,14 +35,15 @@ import {
3535import { KeyboardCommands } from "./keyboard/KeyboardCommands" ;
3636import { registerCommands } from "./registerCommands" ;
3737import { ReleaseNotes } from "./ReleaseNotes" ;
38+ import { ScopeTreeProvider } from "./ScopeTreeProvider" ;
3839import {
3940 ScopeVisualizer ,
41+ VisualizerScopeTypeListener as ScopeVisualizerListener ,
4042 VisualizationType ,
41- VisualizerScopeTypeListener ,
4243} from "./ScopeVisualizerCommandApi" ;
4344import { StatusBarItem } from "./StatusBarItem" ;
4445import { vscodeApi } from "./vscodeApi" ;
45- import { ScopeTreeProvider } from "./ScopeTreeProvider " ;
46+ import { revisualizeOnCustomRegexChange } from "./revisualizeOnCustomRegexChange " ;
4647
4748/**
4849 * Extension entrypoint called by VSCode on Cursorless startup.
@@ -97,6 +98,9 @@ export async function activate(
9798 const statusBarItem = StatusBarItem . create ( "cursorless.showQuickPick" ) ;
9899 const keyboardCommands = KeyboardCommands . create ( context , statusBarItem ) ;
99100 const scopeVisualizer = createScopeVisualizer ( normalizedIde , scopeProvider ) ;
101+ context . subscriptions . push (
102+ revisualizeOnCustomRegexChange ( scopeVisualizer , scopeProvider ) ,
103+ ) ;
100104 ScopeTreeProvider . create (
101105 vscodeApi ,
102106 context ,
@@ -178,7 +182,7 @@ function createScopeVisualizer(
178182 let scopeVisualizer : VscodeScopeVisualizer | undefined ;
179183 let currentScopeType : ScopeType | undefined ;
180184
181- const listeners : VisualizerScopeTypeListener [ ] = [ ] ;
185+ const listeners : ScopeVisualizerListener [ ] = [ ] ;
182186
183187 return {
184188 start ( scopeType : ScopeType , visualizationType : VisualizationType ) {
@@ -191,21 +195,21 @@ function createScopeVisualizer(
191195 ) ;
192196 scopeVisualizer . start ( ) ;
193197 currentScopeType = scopeType ;
194- listeners . forEach ( ( listener ) => listener ( scopeType ) ) ;
198+ listeners . forEach ( ( listener ) => listener ( scopeType , visualizationType ) ) ;
195199 } ,
196200
197201 stop ( ) {
198202 scopeVisualizer ?. dispose ( ) ;
199203 scopeVisualizer = undefined ;
200204 currentScopeType = undefined ;
201- listeners . forEach ( ( listener ) => listener ( undefined ) ) ;
205+ listeners . forEach ( ( listener ) => listener ( undefined , undefined ) ) ;
202206 } ,
203207
204208 get scopeType ( ) {
205209 return currentScopeType ;
206210 } ,
207211
208- onDidChangeScopeType ( listener : VisualizerScopeTypeListener ) : Disposable {
212+ onDidChangeScopeType ( listener : ScopeVisualizerListener ) : Disposable {
209213 listeners . push ( listener ) ;
210214
211215 return {
0 commit comments