Skip to content

Commit

Permalink
Rebase against the upstream 70e10d6
Browse files Browse the repository at this point in the history
vscode-upstream-sha1: 70e10d6
  • Loading branch information
Eclipse Che Sync committed May 10, 2024
2 parents 155c63d + 70e10d6 commit 94d010f
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 25 deletions.
Expand Up @@ -743,7 +743,7 @@ export class TestParcelWatcher extends ParcelWatcher {
await testCorrelatedWatchFolderDoesNotExist(false);
});

test('correlated watch requests support suspend/resume (folder, does not exist in beginning, reusing watcher)', async () => {
(!isMacintosh /* Linux/Windows: times out for some reason */ ? test.skip : test)('correlated watch requests support suspend/resume (folder, does not exist in beginning, reusing watcher)', async () => {
await testCorrelatedWatchFolderDoesNotExist(true);
});

Expand Down Expand Up @@ -798,7 +798,7 @@ export class TestParcelWatcher extends ParcelWatcher {
await testCorrelatedWatchFolderExists(false);
});

test('correlated watch requests support suspend/resume (folder, exist in beginning, reusing watcher)', async () => {
(!isMacintosh /* Linux/Windows: times out for some reason */ ? test.skip : test)('correlated watch requests support suspend/resume (folder, exist in beginning, reusing watcher)', async () => {
await testCorrelatedWatchFolderExists(true);
});

Expand Down
10 changes: 8 additions & 2 deletions code/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts
Expand Up @@ -480,8 +480,11 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
element.currentRenderedHeight = newHeight;
if (fireEvent) {
const disposable = templateData.elementDisposables.add(dom.scheduleAtNextAnimationFrame(dom.getWindow(templateData.value), () => {
// Have to recompute the height here because codeblock rendering is currently async and it may have changed.
// If it becomes properly sync, then this could be removed.
element.currentRenderedHeight = templateData.rowContainer.offsetHeight;
disposable.dispose();
this._onDidChangeItemHeight.fire({ element, height: newHeight });
this._onDidChangeItemHeight.fire({ element, height: element.currentRenderedHeight });
}));
}
}
Expand Down Expand Up @@ -514,8 +517,11 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
element.currentRenderedHeight = newHeight;
if (fireEvent) {
const disposable = templateData.elementDisposables.add(dom.scheduleAtNextAnimationFrame(dom.getWindow(templateData.value), () => {
// Have to recompute the height here because codeblock rendering is currently async and it may have changed.
// If it becomes properly sync, then this could be removed.
element.currentRenderedHeight = templateData.rowContainer.offsetHeight;
disposable.dispose();
this._onDidChangeItemHeight.fire({ element, height: newHeight });
this._onDidChangeItemHeight.fire({ element, height: element.currentRenderedHeight });
}));
}
}
Expand Down
Expand Up @@ -675,17 +675,35 @@ export class StartVoiceChatAction extends Action2 {

const InstallingSpeechProvider = new RawContextKey<boolean>('installingSpeechProvider', false, true);

export class InstallVoiceChatAction extends Action2 {

static readonly ID = 'workbench.action.chat.installVoiceChat';
abstract class BaseInstallSpeechProviderAction extends Action2 {

private static readonly SPEECH_EXTENSION_ID = 'ms-vscode.vscode-speech';

async run(accessor: ServicesAccessor): Promise<void> {
const contextKeyService = accessor.get(IContextKeyService);
const extensionsWorkbenchService = accessor.get(IExtensionsWorkbenchService);
try {
InstallingSpeechProvider.bindTo(contextKeyService).set(true);
await extensionsWorkbenchService.install(BaseInstallSpeechProviderAction.SPEECH_EXTENSION_ID, {
justification: this.getJustification(),
enable: true
}, ProgressLocation.Notification);
} finally {
InstallingSpeechProvider.bindTo(contextKeyService).set(false);
}
}

protected abstract getJustification(): string;
}

export class InstallSpeechProviderForVoiceChatAction extends BaseInstallSpeechProviderAction {

static readonly ID = 'workbench.action.chat.installProviderForVoiceChat';

constructor() {
super({
id: InstallVoiceChatAction.ID,
title: localize2('workbench.action.chat.startVoiceChat.label', "Start Voice Chat"),
category: CHAT_CATEGORY,
id: InstallSpeechProviderForVoiceChatAction.ID,
title: localize2('workbench.action.chat.installProviderForVoiceChat.label', "Start Voice Chat"),
icon: Codicon.mic,
precondition: InstallingSpeechProvider.negate(),
menu: [{
Expand All @@ -702,18 +720,8 @@ export class InstallVoiceChatAction extends Action2 {
});
}

async run(accessor: ServicesAccessor): Promise<void> {
const contextKeyService = accessor.get(IContextKeyService);
const extensionsWorkbenchService = accessor.get(IExtensionsWorkbenchService);
try {
InstallingSpeechProvider.bindTo(contextKeyService).set(true);
await extensionsWorkbenchService.install(InstallVoiceChatAction.SPEECH_EXTENSION_ID, {
justification: localize('confirmInstallDetail', "Microphone support requires this extension."),
enable: true
}, ProgressLocation.Notification);
} finally {
InstallingSpeechProvider.bindTo(contextKeyService).set(false);
}
protected getJustification(): string {
return localize('installProviderForVoiceChat.justification', "Microphone support requires this extension.");
}
}

Expand Down Expand Up @@ -857,13 +865,35 @@ class ChatSynthesizerSessions {
}
}

export class InstallSpeechProviderForSynthesizeChatAction extends BaseInstallSpeechProviderAction {

static readonly ID = 'workbench.action.chat.installProviderForSynthesis';

constructor() {
super({
id: InstallSpeechProviderForSynthesizeChatAction.ID,
title: localize2('workbench.action.chat.installProviderForSynthesis.label', "Read Aloud"),
icon: Codicon.unmute,
precondition: InstallingSpeechProvider.negate(),
menu: [{
id: MenuId.ChatMessageTitle,
when: HasSpeechProvider.negate(),
group: 'navigation'
}]
});
}

protected getJustification(): string {
return localize('installProviderForSynthesis.justification', "Speaker support requires this extension.");
}
}

export class ReadChatItemAloud extends Action2 {
constructor() {
super({
id: 'workbench.action.chat.readChatItemAloud',
title: localize2('workbench.action.chat.readChatItemAloud', "Read Aloud"),
f1: false,
category: CHAT_CATEGORY,
icon: Codicon.unmute,
precondition: CanVoiceChat,
menu: {
Expand Down
Expand Up @@ -3,12 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { InlineVoiceChatAction, QuickVoiceChatAction, StartVoiceChatAction, StopListeningInQuickChatAction, StopListeningInChatEditorAction, StopListeningInChatViewAction, VoiceChatInChatViewAction, StopListeningAction, StopListeningAndSubmitAction, KeywordActivationContribution, InstallVoiceChatAction, StopListeningInTerminalChatAction, HoldToVoiceChatInChatViewAction, ReadChatItemAloud, StopReadAloud, StopReadChatItemAloud } from 'vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions';
import { InlineVoiceChatAction, QuickVoiceChatAction, StartVoiceChatAction, StopListeningInQuickChatAction, StopListeningInChatEditorAction, StopListeningInChatViewAction, VoiceChatInChatViewAction, StopListeningAction, StopListeningAndSubmitAction, KeywordActivationContribution, InstallSpeechProviderForSynthesizeChatAction, InstallSpeechProviderForVoiceChatAction, StopListeningInTerminalChatAction, HoldToVoiceChatInChatViewAction, ReadChatItemAloud, StopReadAloud, StopReadChatItemAloud } from 'vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions';
import { registerAction2 } from 'vs/platform/actions/common/actions';
import { WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions';

registerAction2(StartVoiceChatAction);
registerAction2(InstallVoiceChatAction);
registerAction2(InstallSpeechProviderForVoiceChatAction);

registerAction2(VoiceChatInChatViewAction);
registerAction2(HoldToVoiceChatInChatViewAction);
Expand All @@ -26,5 +26,6 @@ registerAction2(StopListeningInTerminalChatAction);
registerAction2(ReadChatItemAloud);
registerAction2(StopReadChatItemAloud);
registerAction2(StopReadAloud);
registerAction2(InstallSpeechProviderForSynthesizeChatAction);

registerWorkbenchContribution2(KeywordActivationContribution.ID, KeywordActivationContribution, WorkbenchPhase.AfterRestored);

0 comments on commit 94d010f

Please sign in to comment.