Skip to content

Commit

Permalink
Rebase against the upstream bd3a9d6
Browse files Browse the repository at this point in the history
vscode-upstream-sha1: bd3a9d6
  • Loading branch information
Eclipse Che Sync committed Sep 27, 2023
2 parents 9f6856c + bd3a9d6 commit 8a15a1b
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 3 deletions.
2 changes: 2 additions & 0 deletions code/src/vs/platform/userDataSync/common/extensionsMerge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export function merge(localExtensions: ILocalSyncExtension[], remoteExtensions:
localExtensions.forEach(({ identifier }) => addUUID(identifier));
remoteExtensions.forEach(({ identifier }) => addUUID(identifier));
lastSyncExtensions?.forEach(({ identifier }) => addUUID(identifier));
skippedExtensions?.forEach(({ identifier }) => addUUID(identifier));
lastSyncBuiltinExtensions?.forEach(identifier => addUUID(identifier));

const getKey = (extension: ISyncExtension): string => {
const uuid = extension.identifier.uuid || uuids.get(extension.identifier.id.toLowerCase());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,40 @@ suite('ExtensionsMerge', () => {
assert.deepStrictEqual(actual.remote, null);
});

test('merge does not remove remote extension when skipped extension has uuid but remote does not has', () => {
const localExtensions = [
aLocalSyncExtension({ identifier: { id: 'a', uuid: 'a' } }),
];
const remoteExtensions = [
aRemoteSyncExtension({ identifier: { id: 'a', uuid: 'a' } }),
aRemoteSyncExtension({ identifier: { id: 'b' } }),
];

const actual = merge(localExtensions, remoteExtensions, remoteExtensions, [aRemoteSyncExtension({ identifier: { id: 'b', uuid: 'b' } })], [], []);

assert.deepStrictEqual(actual.local.added, []);
assert.deepStrictEqual(actual.local.removed, []);
assert.deepStrictEqual(actual.local.updated, []);
assert.deepStrictEqual(actual.remote, null);
});

test('merge does not remove remote extension when last sync builtin extension has uuid but remote does not has', () => {
const localExtensions = [
aLocalSyncExtension({ identifier: { id: 'a', uuid: 'a' } }),
];
const remoteExtensions = [
aRemoteSyncExtension({ identifier: { id: 'a', uuid: 'a' } }),
aRemoteSyncExtension({ identifier: { id: 'b' } }),
];

const actual = merge(localExtensions, remoteExtensions, remoteExtensions, [], [], [{ id: 'b', uuid: 'b' }]);

assert.deepStrictEqual(actual.local.added, []);
assert.deepStrictEqual(actual.local.removed, []);
assert.deepStrictEqual(actual.local.updated, []);
assert.deepStrictEqual(actual.remote, null);
});

function anExpectedSyncExtension(extension: Partial<ISyncExtension>): ISyncExtension {
return {
identifier: { id: 'a', uuid: 'a' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CommandCenterCenterViewItem extends BaseActionViewItem {
@IKeybindingService private _keybindingService: IKeybindingService,
@IInstantiationService private _instaService: IInstantiationService,
) {
super(undefined, _submenu.actions[0], options);
super(undefined, _submenu.actions.find(action => action.id === 'workbench.action.quickOpenWithModes') ?? _submenu.actions[0], options);
}

override render(container: HTMLElement): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@
padding: 0 12px;
}

.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center.multiple.active .action-label {
background-color: inherit;
}

.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center:only-child {
margin-left: 0; /* no margin if there is only the command center, without nav buttons */
}
Expand Down
6 changes: 4 additions & 2 deletions code/src/vs/workbench/contrib/debug/browser/debugToolBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,14 @@ MenuRegistry.onDidChangeMenu(e => {
});


const CONTEXT_TOOLBAR_COMMAND_CENTER = ContextKeyExpr.equals('config.debug.toolBarLocation', 'commandCenter');

MenuRegistry.appendMenuItem(MenuId.CommandCenterCenter, {
submenu: MenuId.DebugToolBar,
title: 'Debug',
icon: Codicon.debug,
order: 1,
when: ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.equals('config.debug.toolBarLocation', 'commandCenter'))
when: ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_TOOLBAR_COMMAND_CENTER)
});

registerDebugToolBarItem(CONTINUE_ID, CONTINUE_LABEL, 10, icons.debugContinue, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
Expand All @@ -354,7 +356,7 @@ registerDebugToolBarItem(STEP_OUT_ID, STEP_OUT_LABEL, 40, icons.debugStepOut, un
registerDebugToolBarItem(RESTART_SESSION_ID, RESTART_LABEL, 60, icons.debugRestart);
registerDebugToolBarItem(STEP_BACK_ID, localize('stepBackDebug', "Step Back"), 50, icons.debugStepBack, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
registerDebugToolBarItem(REVERSE_CONTINUE_ID, localize('reverseContinue', "Reverse"), 55, icons.debugReverseContinue, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_DEBUG_STATE.isEqualTo('stopped'));
registerDebugToolBarItem(FOCUS_SESSION_ID, FOCUS_SESSION_LABEL, 100, Codicon.listTree, CONTEXT_MULTI_SESSION_DEBUG);
registerDebugToolBarItem(FOCUS_SESSION_ID, FOCUS_SESSION_LABEL, 100, Codicon.listTree, ContextKeyExpr.and(CONTEXT_MULTI_SESSION_DEBUG, CONTEXT_TOOLBAR_COMMAND_CENTER.negate()));

MenuRegistry.appendMenuItem(MenuId.DebugToolBarStop, {
group: 'navigation',
Expand Down

0 comments on commit 8a15a1b

Please sign in to comment.