11import type {
22 CommandHistoryStorage ,
33 CursorlessCommandId ,
4+ ScopeType ,
45} from "@cursorless/common" ;
56import { CURSORLESS_COMMAND_ID } from "@cursorless/common" ;
67import {
@@ -18,7 +19,10 @@ import type {
1819} from "@cursorless/test-case-recorder" ;
1920import * as vscode from "vscode" ;
2021import type { InstallationDependencies } from "./InstallationDependencies" ;
21- import type { ScopeVisualizer } from "./ScopeVisualizerCommandApi" ;
22+ import type {
23+ ScopeVisualizer ,
24+ VisualizationType ,
25+ } from "./ScopeVisualizerCommandApi" ;
2226import type { VscodeSnippets } from "./VscodeSnippets" ;
2327import type { VscodeTutorial } from "./VscodeTutorial" ;
2428import {
@@ -102,7 +106,15 @@ export function registerCommands(
102106 [ "cursorless.recomputeDecorationStyles" ] : hats . recomputeDecorationStyles ,
103107
104108 // Scope visualizer
105- [ "cursorless.showScopeVisualizer" ] : scopeVisualizer . start ,
109+ [ "cursorless.showScopeVisualizer" ] : (
110+ scopeType ?: ScopeType ,
111+ visualizationType ?: VisualizationType ,
112+ ) => {
113+ if ( scopeType == null || visualizationType == null ) {
114+ throw new Error ( "Missing arguments. Only for internal use." ) ;
115+ }
116+ scopeVisualizer . start ( scopeType , visualizationType ) ;
117+ } ,
106118 [ "cursorless.hideScopeVisualizer" ] : scopeVisualizer . stop ,
107119 [ "cursorless.scopeVisualizer.openUrl" ] :
108120 showScopeVisualizerItemDocumentation ,
0 commit comments