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 {
42
42
this . name = "NeedsInitialTalonUpdateError" ;
43
43
}
44
44
}
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" ;
2
6
3
7
export class DisabledTalonSpokenForms implements TalonSpokenForms {
4
8
getSpokenFormEntries ( ) : Promise < SpokenFormEntry [ ] > {
5
- throw Error ( "Talon spoken forms are not implemented." ) ;
9
+ throw new DisabledCustomSpokenFormsError ( ) ;
6
10
}
7
11
8
12
onDidChange ( ) {
Original file line number Diff line number Diff line change 1
1
import {
2
2
CustomRegexScopeType ,
3
+ DisabledCustomSpokenFormsError ,
3
4
Disposable ,
4
5
NeedsInitialTalonUpdateError ,
5
6
Notifier ,
@@ -81,6 +82,8 @@ export class CustomSpokenForms {
81
82
if ( err instanceof NeedsInitialTalonUpdateError ) {
82
83
// Handle case where spokenForms.json doesn't exist yet
83
84
this . needsInitialTalonUpdate_ = true ;
85
+ } else if ( err instanceof DisabledCustomSpokenFormsError ) {
86
+ // Do nothing: this ide doesn't currently support custom spoken forms
84
87
} else {
85
88
console . error ( "Error loading custom spoken forms" , err ) ;
86
89
const msg = ( err as Error ) . message . replace ( / \. $ / , "" ) ;
You can’t perform that action at this time.
0 commit comments