Merge from vscode 5d18ad4c5902e3bddbc9f78da82dfc2ac349e908 (#9683)

This commit is contained in:
Anthony Dresser
2020-03-20 01:17:27 -07:00
committed by GitHub
parent 1520441b84
commit dd8fb9433b
89 changed files with 3095 additions and 445 deletions

View File

@@ -16,7 +16,7 @@ import { IsFullscreenContext } from 'vs/workbench/browser/contextkeys';
import { IsMacNativeContext, IsDevelopmentContext } from 'vs/platform/contextkey/common/contextkeys';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { IQuickInputButton, IQuickInputService, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';
import { IQuickInputButton, IQuickInputService, IQuickPickSeparator, IKeyMods } from 'vs/platform/quickinput/common/quickInput';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { ILabelService } from 'vs/platform/label/common/label';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
@@ -27,7 +27,6 @@ import { URI } from 'vs/base/common/uri';
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
import { FileKind } from 'vs/platform/files/common/files';
import { splitName } from 'vs/base/common/labels';
import { IKeyMods } from 'vs/base/parts/quickopen/common/quickOpen';
import { isMacintosh } from 'vs/base/common/platform';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { inQuickOpenContext, getQuickNavigateHandler } from 'vs/workbench/browser/parts/quickopen/quickopen';

View File

@@ -8,16 +8,20 @@
overflow: hidden;
}
.monaco-workbench .part > .drop-block-overlay.visible {
display: block;
backdrop-filter: brightness(97%) blur(2px);
opacity: 1;
z-index: 10;
}
.monaco-workbench .part > .drop-block-overlay {
visibility: hidden; /* use visibility to ensure transitions */
transition-property: opacity;
transition-timing-function: linear;
transition-duration: 250ms;
display: none;
width: 100%;
height: 100%;
position: absolute;
top: 0;
opacity: 0;
pointer-events: none;
}

View File

@@ -7,12 +7,6 @@
width: 48px;
}
.monaco-workbench .part > .drop-block-overlay.visible {
visibility: visible;
backdrop-filter: brightness(97%) blur(2px);
opacity: 1;
}
.monaco-workbench .activitybar > .content {
height: 100%;
display: flex;

View File

@@ -26,7 +26,7 @@ import { EditorInput, IWorkbenchEditorConfiguration, IEditorInput } from 'vs/wor
import { Component } from 'vs/workbench/common/component';
import { Event, Emitter } from 'vs/base/common/event';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { QuickOpenHandler, QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions, EditorQuickOpenEntry, CLOSE_ON_FOCUS_LOST_CONFIG, SEARCH_EDITOR_HISTORY, PRESERVE_INPUT_CONFIG } from 'vs/workbench/browser/quickopen';
import { QuickOpenHandler, QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions, EditorQuickOpenEntry, CLOSE_ON_FOCUS_LOST_CONFIG, SEARCH_EDITOR_HISTORY, PRESERVE_INPUT_CONFIG, ENABLE_EXPERIMENTAL_VERSION_CONFIG } from 'vs/workbench/browser/quickopen';
import * as errors from 'vs/base/common/errors';
import { IQuickOpenService, IShowOptions } from 'vs/platform/quickOpen/common/quickOpen';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@@ -86,6 +86,10 @@ export class QuickOpenController extends Component implements IQuickOpenService
private editorHistoryHandler: EditorHistoryHandler;
private pendingGetResultsInvocation: CancellationTokenSource | null = null;
private get useNewExperimentalVersion() {
return this.configurationService.getValue(ENABLE_EXPERIMENTAL_VERSION_CONFIG) === true;
}
constructor(
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
@INotificationService private readonly notificationService: INotificationService,
@@ -95,7 +99,8 @@ export class QuickOpenController extends Component implements IQuickOpenService
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
@IEnvironmentService private readonly environmentService: IEnvironmentService,
@IThemeService themeService: IThemeService,
@IStorageService storageService: IStorageService
@IStorageService storageService: IStorageService,
@IQuickInputService private readonly quickInputService: IQuickInputService
) {
super(QuickOpenController.ID, themeService, storageService);
@@ -125,26 +130,42 @@ export class QuickOpenController extends Component implements IQuickOpenService
}
navigate(next: boolean, quickNavigate?: IQuickNavigateConfiguration): void {
if (this.quickOpenWidget) {
this.quickOpenWidget.navigate(next, quickNavigate);
if (this.useNewExperimentalVersion) {
// already handled
} else {
if (this.quickOpenWidget) {
this.quickOpenWidget.navigate(next, quickNavigate);
}
}
}
accept(): void {
if (this.quickOpenWidget && this.quickOpenWidget.isVisible()) {
this.quickOpenWidget.accept();
if (this.useNewExperimentalVersion) {
// already handled
} else {
if (this.quickOpenWidget && this.quickOpenWidget.isVisible()) {
this.quickOpenWidget.accept();
}
}
}
focus(): void {
if (this.quickOpenWidget && this.quickOpenWidget.isVisible()) {
this.quickOpenWidget.focus();
if (this.useNewExperimentalVersion) {
// already handled
} else {
if (this.quickOpenWidget && this.quickOpenWidget.isVisible()) {
this.quickOpenWidget.focus();
}
}
}
close(): void {
if (this.quickOpenWidget && this.quickOpenWidget.isVisible()) {
this.quickOpenWidget.hide(HideReason.CANCELED);
if (this.useNewExperimentalVersion) {
// already handled
} else {
if (this.quickOpenWidget && this.quickOpenWidget.isVisible()) {
this.quickOpenWidget.hide(HideReason.CANCELED);
}
}
}
@@ -157,6 +178,12 @@ export class QuickOpenController extends Component implements IQuickOpenService
}
show(prefix?: string, options?: IShowOptions): Promise<void> {
if (this.useNewExperimentalVersion) {
this.quickInputService.quickAccess.show(prefix, options);
return Promise.resolve();
}
let quickNavigateConfiguration = options ? options.quickNavigateConfiguration : undefined;
let inputSelection = options ? options.inputSelection : undefined;
let autoFocus = options ? options.autoFocus : undefined;

View File

@@ -336,7 +336,7 @@ export abstract class ViewPane extends Pane implements IView {
}
if (this.progressIndicator === undefined) {
this.progressIndicator = this.instantiationService.createInstance(CompositeProgressIndicator, assertIsDefined(this.progressBar), this.id, this.isVisible());
this.progressIndicator = this.instantiationService.createInstance(CompositeProgressIndicator, assertIsDefined(this.progressBar), this.id, this.isBodyVisible());
}
return this.progressIndicator;
}

View File

@@ -21,6 +21,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
export const CLOSE_ON_FOCUS_LOST_CONFIG = 'workbench.quickOpen.closeOnFocusLost';
export const PRESERVE_INPUT_CONFIG = 'workbench.quickOpen.preserveInput';
export const ENABLE_EXPERIMENTAL_VERSION_CONFIG = 'workbench.quickOpen.enableExperimentalNewVersion';
export const SEARCH_EDITOR_HISTORY = 'search.quickOpen.includeHistory';
export interface IWorkbenchQuickOpenConfiguration {
@@ -28,6 +29,9 @@ export interface IWorkbenchQuickOpenConfiguration {
commandPalette: {
history: number;
preserveInput: boolean;
},
quickOpen: {
enableExperimentalNewVersion: boolean;
}
};
}

View File

@@ -14,18 +14,22 @@ import { isSafari, isStandalone } from 'vs/base/browser/browser';
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
// Icon defaults
const iconForegroundColor = theme.getColor(iconForeground);
if (iconForegroundColor) {
collector.addRule(`.monaco-workbench .codicon { color: ${iconForegroundColor}; }`);
}
// Foreground
const windowForeground = theme.getColor(foreground);
if (windowForeground) {
collector.addRule(`.monaco-workbench { color: ${windowForeground}; }`);
}
// Background (We need to set the workbench background color so that on Windows we get subpixel-antialiasing)
const workbenchBackground = WORKBENCH_BACKGROUND(theme);
collector.addRule(`.monaco-workbench { background-color: ${workbenchBackground}; }`);
// Icon defaults
const iconForegroundColor = theme.getColor(iconForeground);
if (iconForegroundColor) {
collector.addRule(`.monaco-workbench .codicon { color: ${iconForegroundColor}; }`);
}
// Selection
const windowSelectionBackground = theme.getColor(selectionBackground);
if (windowSelectionBackground) {
@@ -58,10 +62,6 @@ registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) =
`);
}
// We need to set the workbench background color so that on Windows we get subpixel-antialiasing.
const workbenchBackground = WORKBENCH_BACKGROUND(theme);
collector.addRule(`.monaco-workbench { background-color: ${workbenchBackground}; }`);
// Scrollbars
const scrollbarShadowColor = theme.getColor(scrollbarShadow);
if (scrollbarShadowColor) {

View File

@@ -179,6 +179,11 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio
'description': nls.localize('workbench.quickOpen.preserveInput', "Controls whether the last typed input to Quick Open should be restored when opening it the next time."),
'default': false
},
'workbench.quickOpen.enableExperimentalNewVersion': {
'type': 'boolean',
'description': nls.localize('workbench.quickOpen.enableExperimentalNewVersion', "Will use the new quick open implementation for testing purposes."),
'default': false
},
'workbench.settings.openDefaultSettings': {
'type': 'boolean',
'description': nls.localize('openDefaultSettings', "Controls whether opening settings also opens an editor showing all default settings."),

View File

@@ -323,6 +323,9 @@ export class Workbench extends Layout {
private renderWorkbench(instantiationService: IInstantiationService, notificationService: NotificationService, storageService: IStorageService, configurationService: IConfigurationService): void {
// ARIA
this.container.setAttribute('role', 'application');
// State specific classes
const platformClass = isWindows ? 'windows' : isLinux ? 'linux' : 'mac';
const workbenchClasses = coalesce([
@@ -335,7 +338,6 @@ export class Workbench extends Layout {
addClasses(this.container, ...workbenchClasses);
addClass(document.body, platformClass); // used by our fonts
this.container.setAttribute('role', 'application');
if (isWeb) {
addClass(document.body, 'web');