Skip to content

Commit

Permalink
Rebase against the upstream 101b288
Browse files Browse the repository at this point in the history
vscode-upstream-sha1: 101b288
  • Loading branch information
Eclipse Che Sync committed Jul 29, 2023
2 parents cccf14f + 101b288 commit 35263b1
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,11 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
private async createQuickpickItems(sessions: ExistingSessionItem[]): Promise<(ExistingSessionItem | AuthenticationProviderOption | IQuickPickSeparator | IQuickPickItem & { canceledAuthentication: boolean })[]> {
const options: (ExistingSessionItem | AuthenticationProviderOption | IQuickPickSeparator | IQuickPickItem & { canceledAuthentication: boolean })[] = [];

options.push({ type: 'separator', label: localize('signed in', "Signed In") });

options.push(...sessions);

options.push({ type: 'separator', label: localize('others', "Others") });
if (sessions.length) {
options.push({ type: 'separator', label: localize('signed in', "Signed In") });
options.push(...sessions);
options.push({ type: 'separator', label: localize('others', "Others") });
}

for (const authenticationProvider of (await this.getAuthenticationProviders())) {
const signedInForProvider = sessions.some(account => account.providerId === authenticationProvider.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,16 +503,13 @@ const terminalConfiguration: IConfigurationNode = {
[TerminalSettingId.LocalEchoStyle]: {
description: localize('terminal.integrated.localEchoStyle', "Terminal style of locally echoed text; either a font style or an RGB color."),
default: 'dim',
oneOf: [
anyOf: [
{
type: 'string',
default: 'dim',
enum: ['bold', 'dim', 'italic', 'underlined', 'inverted'],
enum: ['bold', 'dim', 'italic', 'underlined', 'inverted', '#ff0000'],
},
{
type: 'string',
format: 'color-hex',
default: '#ff0000',
}
]
},
Expand Down
23 changes: 13 additions & 10 deletions code/src/vs/workbench/contrib/testing/browser/testingOutputPeek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import { ICodeEditor, IDiffEditorConstructionOptions, isCodeEditor } from 'vs/ed
import { EditorAction2 } from 'vs/editor/browser/editorExtensions';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';
import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditorWidget';
import { EmbeddedCodeEditorWidget, EmbeddedDiffEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';
import { DiffEditorWidget2 } from 'vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2';
import { EmbeddedCodeEditorWidget, EmbeddedDiffEditorWidget2 } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';
import { IDiffEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions';
import { Position } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
Expand All @@ -54,6 +54,7 @@ import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/con
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { WorkbenchCompressibleObjectTree } from 'vs/platform/list/browser/listService';
Expand Down Expand Up @@ -801,16 +802,16 @@ class TestResultsPeek extends PeekViewWidget {
private static lastHeightInLines?: number;

private readonly visibilityChange = this._disposables.add(new Emitter<boolean>());
private readonly content: TestResultsViewContent;
private scopedContextKeyService?: IContextKeyService;
private content!: TestResultsViewContent;
private scopedContextKeyService!: IContextKeyService;
private dimension?: dom.Dimension;
public current?: InspectSubject;

constructor(
editor: ICodeEditor,
@IThemeService themeService: IThemeService,
@IPeekViewService peekViewService: IPeekViewService,
@ITestingPeekOpener testingPeek: ITestingPeekOpener,
@ITestingPeekOpener private readonly testingPeek: ITestingPeekOpener,
@IContextKeyService private readonly contextKeyService: IContextKeyService,
@IMenuService private readonly menuService: IMenuService,
@IInstantiationService instantiationService: IInstantiationService,
Expand All @@ -820,7 +821,6 @@ class TestResultsPeek extends PeekViewWidget {

this._disposables.add(themeService.onDidColorThemeChange(this.applyTheme, this));
this._disposables.add(this.onDidClose(() => this.visibilityChange.fire(false)));
this.content = this._disposables.add(instantiationService.createInstance(TestResultsViewContent, editor, { historyVisible: testingPeek.historyVisible, showRevealLocationOnMessages: false }));
this.applyTheme(themeService.getColorTheme());
peekViewService.addExclusiveWidget(editor, this);
}
Expand All @@ -841,11 +841,14 @@ class TestResultsPeek extends PeekViewWidget {
if (!this.scopedContextKeyService) {
this.scopedContextKeyService = this._disposables.add(this.contextKeyService.createScoped(container));
TestingContextKeys.isInPeek.bindTo(this.scopedContextKeyService).set(true);
const instaService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService]));
this.content = this._disposables.add(instaService.createInstance(TestResultsViewContent, this.editor, { historyVisible: this.testingPeek.historyVisible, showRevealLocationOnMessages: false }));
}

super._fillContainer(container);
}


protected override _fillHead(container: HTMLElement): void {
super._fillHead(container);

Expand Down Expand Up @@ -1025,7 +1028,7 @@ const isDiffable = (message: ITestMessage): message is ITestErrorMessage & { act
message.type === TestMessageType.Error && message.actual !== undefined && message.expected !== undefined;

class DiffContentProvider extends Disposable implements IPeekOutputRenderer {
private readonly widget = this._register(new MutableDisposable<DiffEditorWidget>());
private readonly widget = this._register(new MutableDisposable<DiffEditorWidget2>());
private readonly model = this._register(new MutableDisposable());
private dimension?: dom.IDimension;

Expand Down Expand Up @@ -1055,13 +1058,13 @@ class DiffContentProvider extends Disposable implements IPeekOutputRenderer {
const model = this.model.value = new SimpleDiffEditorModel(original, modified);
if (!this.widget.value) {
this.widget.value = this.editor ? this.instantiationService.createInstance(
EmbeddedDiffEditorWidget,
EmbeddedDiffEditorWidget2,
this.container,
diffEditorOptions,
{},
this.editor,
) : this.instantiationService.createInstance(
DiffEditorWidget,
DiffEditorWidget2,
this.container,
diffEditorOptions,
{},
Expand Down Expand Up @@ -1406,7 +1409,7 @@ function getOuterEditorFromDiffEditor(codeEditorService: ICodeEditorService): IC
const diffEditors = codeEditorService.listDiffEditors();

for (const diffEditor of diffEditors) {
if (diffEditor.hasTextFocus() && diffEditor instanceof EmbeddedDiffEditorWidget) {
if (diffEditor.hasTextFocus() && diffEditor instanceof EmbeddedDiffEditorWidget2) {
return diffEditor.getParentEditor();
}
}
Expand Down
3 changes: 2 additions & 1 deletion code/src/vs/workbench/services/hover/browser/hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface IHoverService {
* });
* ```
*/
showHover(options: IHoverOptions, focus?: boolean): IHoverWidget | undefined;
showHover(options: Readonly<IHoverOptions>, focus?: boolean): IHoverWidget | undefined;

/**
* Hides the hover if it was visible. This call will be ignored if the the hover is currently
Expand Down Expand Up @@ -145,6 +145,7 @@ export interface IHoverOptions {
* Whether to trap focus in the following ways:
* - When the hover closes, focus goes to the element that had focus before the hover opened
* - If there are elements in the hover to focus, focus stays inside of the hover when tabbing
* Note that this is overridden to true when in screen reader optimized mode.
*/
trapFocus?: boolean;

Expand Down
21 changes: 13 additions & 8 deletions code/src/vs/workbench/services/hover/browser/hoverService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { addDisposableListener, EventType } from 'vs/base/browser/dom';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver';
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';

export class HoverService implements IHoverService {
declare readonly _serviceBrand: undefined;
Expand All @@ -31,23 +32,27 @@ export class HoverService implements IHoverService {
@IInstantiationService private readonly _instantiationService: IInstantiationService,
@IContextViewService private readonly _contextViewService: IContextViewService,
@IContextMenuService contextMenuService: IContextMenuService,
@IKeybindingService private readonly _keybindingService: IKeybindingService
@IKeybindingService private readonly _keybindingService: IKeybindingService,
@IAccessibilityService private readonly _accessibilityService: IAccessibilityService
) {
contextMenuService.onDidShowContextMenu(() => this.hideHover());
}

showHover(options: IHoverOptions, focus?: boolean): IHoverWidget | undefined {
showHover(options: Readonly<IHoverOptions>, focus?: boolean, skipLastFocusedUpdate?: boolean): IHoverWidget | undefined {
if (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {
return undefined;
}
this._currentHoverOptions = options;
this._lastHoverOptions = options;
if (options.trapFocus && document.activeElement) {
this._lastFocusedElementBeforeOpen = document.activeElement as HTMLElement;
} else {
this._lastFocusedElementBeforeOpen = undefined;
const trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();
// HACK, remove this check when #189076 is fixed
if (!skipLastFocusedUpdate) {
if (trapFocus && document.activeElement) {
this._lastFocusedElementBeforeOpen = document.activeElement as HTMLElement;
} else {
this._lastFocusedElementBeforeOpen = undefined;
}
}

const hoverDisposables = new DisposableStore();
const hover = this._instantiationService.createInstance(HoverWidget, options);
hover.onDispose(() => {
Expand Down Expand Up @@ -114,7 +119,7 @@ export class HoverService implements IHoverService {
if (!this._lastHoverOptions) {
return;
}
this.showHover(this._lastHoverOptions, true);
this.showHover(this._lastHoverOptions, true, true);
}

private _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {
Expand Down

0 comments on commit 35263b1

Please sign in to comment.