@codingame/monaco-vscode-speech-service-override 4.5.1 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-speech-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -16,14 +16,11 @@ import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibi
|
|
|
16
16
|
import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
17
17
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
18
18
|
|
|
19
|
+
const _moduleId = "vs/workbench/contrib/speech/browser/speechService";
|
|
19
20
|
const speechProvidersExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
20
21
|
extensionPoint: 'speechProviders',
|
|
21
22
|
jsonSchema: {
|
|
22
|
-
description: ( localizeWithPath(
|
|
23
|
-
'vs/workbench/contrib/speech/browser/speechService',
|
|
24
|
-
'vscode.extension.contributes.speechProvider',
|
|
25
|
-
'Contributes a Speech Provider'
|
|
26
|
-
)),
|
|
23
|
+
description: ( localizeWithPath(_moduleId, 0, 'Contributes a Speech Provider')),
|
|
27
24
|
type: 'array',
|
|
28
25
|
items: {
|
|
29
26
|
additionalProperties: false,
|
|
@@ -32,19 +29,11 @@ const speechProvidersExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
32
29
|
required: ['name'],
|
|
33
30
|
properties: {
|
|
34
31
|
name: {
|
|
35
|
-
description: ( localizeWithPath(
|
|
36
|
-
'vs/workbench/contrib/speech/browser/speechService',
|
|
37
|
-
'speechProviderName',
|
|
38
|
-
"Unique name for this Speech Provider."
|
|
39
|
-
)),
|
|
32
|
+
description: ( localizeWithPath(_moduleId, 1, "Unique name for this Speech Provider.")),
|
|
40
33
|
type: 'string'
|
|
41
34
|
},
|
|
42
35
|
description: {
|
|
43
|
-
description: ( localizeWithPath(
|
|
44
|
-
'vs/workbench/contrib/speech/browser/speechService',
|
|
45
|
-
'speechProviderDescription',
|
|
46
|
-
"A description of this Speech Provider, shown in the UI."
|
|
47
|
-
)),
|
|
36
|
+
description: ( localizeWithPath(_moduleId, 2, "A description of this Speech Provider, shown in the UI.")),
|
|
48
37
|
type: 'string'
|
|
49
38
|
}
|
|
50
39
|
}
|
|
@@ -62,20 +51,20 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
62
51
|
this.configurationService = configurationService;
|
|
63
52
|
this.accessibilitySignalService = accessibilitySignalService;
|
|
64
53
|
this.extensionService = extensionService;
|
|
65
|
-
this._onDidChangeHasSpeechProvider = this._register(( new Emitter()));
|
|
54
|
+
this._onDidChangeHasSpeechProvider = this._register(( (new Emitter())));
|
|
66
55
|
this.onDidChangeHasSpeechProvider = this._onDidChangeHasSpeechProvider.event;
|
|
67
|
-
this.providers = ( new Map());
|
|
68
|
-
this.providerDescriptors = ( new Map());
|
|
56
|
+
this.providers = ( (new Map()));
|
|
57
|
+
this.providerDescriptors = ( (new Map()));
|
|
69
58
|
this.hasSpeechProviderContext = HasSpeechProvider.bindTo(this.contextKeyService);
|
|
70
|
-
this._onDidStartSpeechToTextSession = this._register(( new Emitter()));
|
|
59
|
+
this._onDidStartSpeechToTextSession = this._register(( (new Emitter())));
|
|
71
60
|
this.onDidStartSpeechToTextSession = this._onDidStartSpeechToTextSession.event;
|
|
72
|
-
this._onDidEndSpeechToTextSession = this._register(( new Emitter()));
|
|
61
|
+
this._onDidEndSpeechToTextSession = this._register(( (new Emitter())));
|
|
73
62
|
this.onDidEndSpeechToTextSession = this._onDidEndSpeechToTextSession.event;
|
|
74
63
|
this._activeSpeechToTextSession = undefined;
|
|
75
64
|
this.speechToTextInProgress = SpeechToTextInProgress.bindTo(this.contextKeyService);
|
|
76
|
-
this._onDidStartKeywordRecognition = this._register(( new Emitter()));
|
|
65
|
+
this._onDidStartKeywordRecognition = this._register(( (new Emitter())));
|
|
77
66
|
this.onDidStartKeywordRecognition = this._onDidStartKeywordRecognition.event;
|
|
78
|
-
this._onDidEndKeywordRecognition = this._register(( new Emitter()));
|
|
67
|
+
this._onDidEndKeywordRecognition = this._register(( (new Emitter())));
|
|
79
68
|
this.onDidEndKeywordRecognition = this._onDidEndKeywordRecognition.event;
|
|
80
69
|
this._activeKeywordRecognitionSession = undefined;
|
|
81
70
|
this.handleAndRegisterSpeechExtensions();
|
|
@@ -99,8 +88,8 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
99
88
|
});
|
|
100
89
|
}
|
|
101
90
|
registerSpeechProvider(identifier, provider) {
|
|
102
|
-
if (( this.providers.has(identifier))) {
|
|
103
|
-
throw new Error(`Speech provider with identifier ${identifier} is already registered.`);
|
|
91
|
+
if (( (this.providers.has(identifier)))) {
|
|
92
|
+
throw ( (new Error(`Speech provider with identifier ${identifier} is already registered.`)));
|
|
104
93
|
}
|
|
105
94
|
const oldHasSpeechProvider = this.hasSpeechProvider;
|
|
106
95
|
this.providers.set(identifier, provider);
|
|
@@ -127,7 +116,7 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
127
116
|
const sessionStart = Date.now();
|
|
128
117
|
let sessionRecognized = false;
|
|
129
118
|
let sessionContentLength = 0;
|
|
130
|
-
const disposables = ( new DisposableStore());
|
|
119
|
+
const disposables = ( (new DisposableStore()));
|
|
131
120
|
const onSessionStoppedOrCanceled = () => {
|
|
132
121
|
if (session === this._activeSpeechToTextSession) {
|
|
133
122
|
this._activeSpeechToTextSession = undefined;
|
|
@@ -174,9 +163,9 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
174
163
|
}
|
|
175
164
|
async getProvider() {
|
|
176
165
|
await this.extensionService.activateByEvent('onSpeech');
|
|
177
|
-
const provider = firstOrDefault(Array.from(( this.providers.values())));
|
|
166
|
+
const provider = firstOrDefault(Array.from(( (this.providers.values()))));
|
|
178
167
|
if (!provider) {
|
|
179
|
-
throw new Error(`No Speech provider is registered.`);
|
|
168
|
+
throw ( (new Error(`No Speech provider is registered.`)));
|
|
180
169
|
}
|
|
181
170
|
else if (this.providers.size > 1) {
|
|
182
171
|
this.logService.warn(`Multiple speech providers registered. Picking first one: ${provider.metadata.displayName}`);
|
|
@@ -185,18 +174,18 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
185
174
|
}
|
|
186
175
|
get hasActiveKeywordRecognition() { return !!this._activeKeywordRecognitionSession; }
|
|
187
176
|
async recognizeKeyword(token) {
|
|
188
|
-
const result = ( new DeferredPromise());
|
|
177
|
+
const result = ( (new DeferredPromise()));
|
|
189
178
|
await this.extensionService.activateByEvent('onSpeech');
|
|
190
|
-
const disposables = ( new DisposableStore());
|
|
179
|
+
const disposables = ( (new DisposableStore()));
|
|
191
180
|
disposables.add(token.onCancellationRequested(() => {
|
|
192
181
|
disposables.dispose();
|
|
193
182
|
result.complete(KeywordRecognitionStatus.Canceled);
|
|
194
183
|
}));
|
|
195
|
-
const recognizeKeywordDisposables = disposables.add(( new DisposableStore()));
|
|
184
|
+
const recognizeKeywordDisposables = disposables.add(( (new DisposableStore())));
|
|
196
185
|
let activeRecognizeKeywordSession = undefined;
|
|
197
186
|
const recognizeKeyword = () => {
|
|
198
187
|
recognizeKeywordDisposables.clear();
|
|
199
|
-
const cts = ( new CancellationTokenSource(token));
|
|
188
|
+
const cts = ( (new CancellationTokenSource(token)));
|
|
200
189
|
recognizeKeywordDisposables.add(toDisposable(() => cts.dispose(true)));
|
|
201
190
|
const currentRecognizeKeywordSession = activeRecognizeKeywordSession = this.doRecognizeKeyword(cts.token).then(status => {
|
|
202
191
|
if (currentRecognizeKeywordSession === activeRecognizeKeywordSession) {
|
|
@@ -236,7 +225,7 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
236
225
|
const provider = await this.getProvider();
|
|
237
226
|
const session = this._activeKeywordRecognitionSession = provider.createKeywordRecognitionSession(token);
|
|
238
227
|
this._onDidStartKeywordRecognition.fire();
|
|
239
|
-
const disposables = ( new DisposableStore());
|
|
228
|
+
const disposables = ( (new DisposableStore()));
|
|
240
229
|
const onSessionStoppedOrCanceled = () => {
|
|
241
230
|
if (session === this._activeKeywordRecognitionSession) {
|
|
242
231
|
this._activeKeywordRecognitionSession = undefined;
|
|
@@ -261,14 +250,14 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
261
250
|
}
|
|
262
251
|
}
|
|
263
252
|
};
|
|
264
|
-
SpeechService = ( __decorate([
|
|
265
|
-
( __param(0, ILogService)),
|
|
266
|
-
( __param(1, IContextKeyService)),
|
|
267
|
-
( __param(2, IHostService)),
|
|
268
|
-
( __param(3, ITelemetryService)),
|
|
269
|
-
( __param(4, IConfigurationService)),
|
|
270
|
-
( __param(5, IAccessibilitySignalService)),
|
|
271
|
-
( __param(6, IExtensionService))
|
|
272
|
-
], SpeechService));
|
|
253
|
+
SpeechService = ( (__decorate([
|
|
254
|
+
( (__param(0, ILogService))),
|
|
255
|
+
( (__param(1, IContextKeyService))),
|
|
256
|
+
( (__param(2, IHostService))),
|
|
257
|
+
( (__param(3, ITelemetryService))),
|
|
258
|
+
( (__param(4, IConfigurationService))),
|
|
259
|
+
( (__param(5, IAccessibilitySignalService))),
|
|
260
|
+
( (__param(6, IExtensionService)))
|
|
261
|
+
], SpeechService)));
|
|
273
262
|
|
|
274
263
|
export { SpeechService };
|