forked from cursorless-dev/cursorless
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand scope visualizer api (cursorless-dev#1946)
- Required by cursorless-dev#1942 to be able to tell which scope is currently being visualized to highlight it in the sidebar ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet
- Loading branch information
Showing
3 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
11 changes: 9 additions & 2 deletions
11
packages/cursorless-vscode/src/ScopeVisualizerCommandApi.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import { ScopeType } from "@cursorless/common"; | ||
import { Disposable, ScopeType } from "@cursorless/common"; | ||
|
||
export interface ScopeVisualizerCommandApi { | ||
export type ScopeVisualizerListener = ( | ||
scopeType: ScopeType | undefined, | ||
visualizationType: VisualizationType | undefined, | ||
) => void; | ||
|
||
export interface ScopeVisualizer { | ||
start(scopeType: ScopeType, visualizationType: VisualizationType): void; | ||
stop(): void; | ||
readonly scopeType: ScopeType | undefined; | ||
onDidChangeScopeType(listener: ScopeVisualizerListener): Disposable; | ||
} | ||
|
||
export type VisualizationType = "content" | "removal" | "iteration"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters