mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
fix #209487
This commit is contained in:
parent
8558da1335
commit
7a71cd15d4
|
@ -16,6 +16,7 @@ import { EditorAccessibilityHelpContribution } from 'vs/workbench/contrib/access
|
||||||
import { SaveAccessibilitySignalContribution } from 'vs/workbench/contrib/accessibility/browser/saveAccessibilitySignal';
|
import { SaveAccessibilitySignalContribution } from 'vs/workbench/contrib/accessibility/browser/saveAccessibilitySignal';
|
||||||
import { CommentsAccessibilityHelpContribution } from 'vs/workbench/contrib/comments/browser/commentsAccessibility';
|
import { CommentsAccessibilityHelpContribution } from 'vs/workbench/contrib/comments/browser/commentsAccessibility';
|
||||||
import { DiffEditorActiveAnnouncementContribution } from 'vs/workbench/contrib/accessibility/browser/openDiffEditorAnnouncement';
|
import { DiffEditorActiveAnnouncementContribution } from 'vs/workbench/contrib/accessibility/browser/openDiffEditorAnnouncement';
|
||||||
|
import { SpeechAccessibilitySignalContribution } from 'vs/workbench/contrib/speech/browser/speechAccessibilitySignal';
|
||||||
|
|
||||||
registerAccessibilityConfiguration();
|
registerAccessibilityConfiguration();
|
||||||
registerSingleton(IAccessibleViewService, AccessibleViewService, InstantiationType.Delayed);
|
registerSingleton(IAccessibleViewService, AccessibleViewService, InstantiationType.Delayed);
|
||||||
|
@ -31,5 +32,6 @@ workbenchRegistry.registerWorkbenchContribution(InlineCompletionsAccessibleViewC
|
||||||
|
|
||||||
registerWorkbenchContribution2(AccessibilityStatus.ID, AccessibilityStatus, WorkbenchPhase.BlockRestore);
|
registerWorkbenchContribution2(AccessibilityStatus.ID, AccessibilityStatus, WorkbenchPhase.BlockRestore);
|
||||||
registerWorkbenchContribution2(SaveAccessibilitySignalContribution.ID, SaveAccessibilitySignalContribution, WorkbenchPhase.AfterRestored);
|
registerWorkbenchContribution2(SaveAccessibilitySignalContribution.ID, SaveAccessibilitySignalContribution, WorkbenchPhase.AfterRestored);
|
||||||
|
registerWorkbenchContribution2(SpeechAccessibilitySignalContribution.ID, SpeechAccessibilitySignalContribution, WorkbenchPhase.AfterRestored);
|
||||||
registerWorkbenchContribution2(DiffEditorActiveAnnouncementContribution.ID, DiffEditorActiveAnnouncementContribution, WorkbenchPhase.AfterRestored);
|
registerWorkbenchContribution2(DiffEditorActiveAnnouncementContribution.ID, DiffEditorActiveAnnouncementContribution, WorkbenchPhase.AfterRestored);
|
||||||
registerWorkbenchContribution2(DynamicSpeechAccessibilityConfiguration.ID, DynamicSpeechAccessibilityConfiguration, WorkbenchPhase.AfterRestored);
|
registerWorkbenchContribution2(DynamicSpeechAccessibilityConfiguration.ID, DynamicSpeechAccessibilityConfiguration, WorkbenchPhase.AfterRestored);
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
|
import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
||||||
|
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||||
|
import { ISpeechService } from 'vs/workbench/contrib/speech/common/speechService';
|
||||||
|
|
||||||
|
export class SpeechAccessibilitySignalContribution extends Disposable implements IWorkbenchContribution {
|
||||||
|
|
||||||
|
static readonly ID = 'workbench.contrib.speechAccessibilitySignal';
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
@IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService,
|
||||||
|
@ISpeechService private readonly _speechService: ISpeechService,
|
||||||
|
) {
|
||||||
|
super();
|
||||||
|
this._register(this._speechService.onDidStartSpeechToTextSession(() => this._accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStarted)));
|
||||||
|
this._register(this._speechService.onDidEndSpeechToTextSession(() => this._accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStopped)));
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,6 @@ import { DeferredPromise } from 'vs/base/common/async';
|
||||||
import { ISpeechService, ISpeechProvider, HasSpeechProvider, ISpeechToTextSession, SpeechToTextInProgress, IKeywordRecognitionSession, KeywordRecognitionStatus, SpeechToTextStatus, speechLanguageConfigToLanguage, SPEECH_LANGUAGE_CONFIG } from 'vs/workbench/contrib/speech/common/speechService';
|
import { ISpeechService, ISpeechProvider, HasSpeechProvider, ISpeechToTextSession, SpeechToTextInProgress, IKeywordRecognitionSession, KeywordRecognitionStatus, SpeechToTextStatus, speechLanguageConfigToLanguage, SPEECH_LANGUAGE_CONFIG } from 'vs/workbench/contrib/speech/common/speechService';
|
||||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
||||||
import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||||
|
|
||||||
|
@ -68,7 +67,6 @@ export class SpeechService extends Disposable implements ISpeechService {
|
||||||
@IHostService private readonly hostService: IHostService,
|
@IHostService private readonly hostService: IHostService,
|
||||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||||
@IAccessibilitySignalService private readonly accessibilitySignalService: IAccessibilitySignalService,
|
|
||||||
@IExtensionService private readonly extensionService: IExtensionService
|
@IExtensionService private readonly extensionService: IExtensionService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
@ -156,7 +154,6 @@ export class SpeechService extends Disposable implements ISpeechService {
|
||||||
if (session === this._activeSpeechToTextSession) {
|
if (session === this._activeSpeechToTextSession) {
|
||||||
this._activeSpeechToTextSession = undefined;
|
this._activeSpeechToTextSession = undefined;
|
||||||
this.speechToTextInProgress.reset();
|
this.speechToTextInProgress.reset();
|
||||||
this.accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStopped, { allowManyInParallel: true });
|
|
||||||
this._onDidEndSpeechToTextSession.fire();
|
this._onDidEndSpeechToTextSession.fire();
|
||||||
|
|
||||||
type SpeechToTextSessionClassification = {
|
type SpeechToTextSessionClassification = {
|
||||||
|
@ -201,7 +198,6 @@ export class SpeechService extends Disposable implements ISpeechService {
|
||||||
if (session === this._activeSpeechToTextSession) {
|
if (session === this._activeSpeechToTextSession) {
|
||||||
this.speechToTextInProgress.set(true);
|
this.speechToTextInProgress.set(true);
|
||||||
this._onDidStartSpeechToTextSession.fire();
|
this._onDidStartSpeechToTextSession.fire();
|
||||||
this.accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStarted);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SpeechToTextStatus.Recognizing:
|
case SpeechToTextStatus.Recognizing:
|
||||||
|
|
Loading…
Reference in a new issue