File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -42,3 +42,10 @@ export class NeedsInitialTalonUpdateError extends Error {
4242 this . name = "NeedsInitialTalonUpdateError" ;
4343 }
4444}
45+
46+ export class DisabledCustomSpokenFormsError extends Error {
47+ constructor ( ) {
48+ super ( "Custom spoken forms are not currently supported in this ide" ) ;
49+ this . name = "DisabledCustomSpokenFormsError" ;
50+ }
51+ }
Original file line number Diff line number Diff line change 1- import type { SpokenFormEntry , TalonSpokenForms } from "@cursorless/common" ;
1+ import {
2+ DisabledCustomSpokenFormsError ,
3+ type SpokenFormEntry ,
4+ type TalonSpokenForms ,
5+ } from "@cursorless/common" ;
26
37export class DisabledTalonSpokenForms implements TalonSpokenForms {
48 getSpokenFormEntries ( ) : Promise < SpokenFormEntry [ ] > {
5- throw Error ( "Talon spoken forms are not implemented." ) ;
9+ throw new DisabledCustomSpokenFormsError ( ) ;
610 }
711
812 onDidChange ( ) {
Original file line number Diff line number Diff line change 11import {
22 CustomRegexScopeType ,
3+ DisabledCustomSpokenFormsError ,
34 Disposable ,
45 NeedsInitialTalonUpdateError ,
56 Notifier ,
@@ -81,6 +82,8 @@ export class CustomSpokenForms {
8182 if ( err instanceof NeedsInitialTalonUpdateError ) {
8283 // Handle case where spokenForms.json doesn't exist yet
8384 this . needsInitialTalonUpdate_ = true ;
85+ } else if ( err instanceof DisabledCustomSpokenFormsError ) {
86+ // Do nothing: this ide doesn't currently support custom spoken forms
8487 } else {
8588 console . error ( "Error loading custom spoken forms" , err ) ;
8689 const msg = ( err as Error ) . message . replace ( / \. $ / , "" ) ;
You can’t perform that action at this time.
0 commit comments