@@ -4,12 +4,10 @@ import {
4
4
FileSystem ,
5
5
Hats ,
6
6
IDE ,
7
+ ScopeProvider ,
7
8
} from "@cursorless/common" ;
8
9
import { StoredTargetMap , TestCaseRecorder , TreeSitter } from "." ;
9
10
import { CursorlessEngine } from "./api/CursorlessEngineApi" ;
10
- import { ScopeProvider } from "./api/ScopeProvider" ;
11
- import { ScopeRangeProvider } from "./ScopeVisualizer/ScopeRangeProvider" ;
12
- import { ScopeSupportChecker } from "./ScopeVisualizer/ScopeSupportChecker" ;
13
11
import { Debug } from "./core/Debug" ;
14
12
import { HatTokenMapImpl } from "./core/HatTokenMapImpl" ;
15
13
import { Snippets } from "./core/Snippets" ;
@@ -21,9 +19,13 @@ import { ModifierStageFactoryImpl } from "./processTargets/ModifierStageFactoryI
21
19
import { ScopeHandlerFactoryImpl } from "./processTargets/modifiers/scopeHandlers" ;
22
20
import { runCommand } from "./runCommand" ;
23
21
import { runIntegrationTests } from "./runIntegrationTests" ;
22
+ import { ScopeInfoProvider } from "./scopeProviders/ScopeInfoProvider" ;
23
+ import { ScopeRangeProvider } from "./scopeProviders/ScopeRangeProvider" ;
24
+ import { ScopeRangeWatcher } from "./scopeProviders/ScopeRangeWatcher" ;
25
+ import { ScopeSupportChecker } from "./scopeProviders/ScopeSupportChecker" ;
26
+ import { ScopeSupportWatcher } from "./scopeProviders/ScopeSupportWatcher" ;
24
27
import { TalonSpokenFormsJsonReader } from "./nodeCommon/TalonSpokenFormsJsonReader" ;
25
28
import { injectIde } from "./singletons/ide.singleton" ;
26
- import { ScopeRangeWatcher } from "./ScopeVisualizer/ScopeRangeWatcher" ;
27
29
28
30
export function createCursorlessEngine (
29
31
treeSitter : TreeSitter ,
@@ -93,6 +95,11 @@ export function createCursorlessEngine(
93
95
) ;
94
96
} ,
95
97
} ,
98
+ scopeProvider : createScopeProvider (
99
+ languageDefinitions ,
100
+ storedTargets ,
101
+ customSpokenFormGenerator ,
102
+ ) ,
96
103
customSpokenFormGenerator,
97
104
testCaseRecorder,
98
105
storedTargets,
@@ -108,6 +115,7 @@ export function createCursorlessEngine(
108
115
function createScopeProvider (
109
116
languageDefinitions : LanguageDefinitions ,
110
117
storedTargets : StoredTargetMap ,
118
+ customSpokenFormGenerator : CustomSpokenFormGeneratorImpl ,
111
119
) : ScopeProvider {
112
120
const scopeHandlerFactory = new ScopeHandlerFactoryImpl ( languageDefinitions ) ;
113
121
@@ -125,6 +133,12 @@ function createScopeProvider(
125
133
rangeProvider ,
126
134
) ;
127
135
const supportChecker = new ScopeSupportChecker ( scopeHandlerFactory ) ;
136
+ const infoProvider = new ScopeInfoProvider ( customSpokenFormGenerator ) ;
137
+ const supportWatcher = new ScopeSupportWatcher (
138
+ languageDefinitions ,
139
+ supportChecker ,
140
+ infoProvider ,
141
+ ) ;
128
142
129
143
return {
130
144
provideScopeRanges : rangeProvider . provideScopeRanges ,
@@ -134,5 +148,8 @@ function createScopeProvider(
134
148
rangeWatcher . onDidChangeIterationScopeRanges ,
135
149
getScopeSupport : supportChecker . getScopeSupport ,
136
150
getIterationScopeSupport : supportChecker . getIterationScopeSupport ,
151
+ onDidChangeScopeSupport : supportWatcher . onDidChangeScopeSupport ,
152
+ getScopeInfo : infoProvider . getScopeTypeInfo ,
153
+ onDidChangeScopeInfo : infoProvider . onDidChangeScopeInfo ,
137
154
} ;
138
155
}
0 commit comments