mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 19:18:32 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -39,8 +39,10 @@ export abstract class AbstractCommandsQuickAccessProvider extends PickerQuickAcc
|
||||
|
||||
private readonly commandsHistory = this._register(this.instantiationService.createInstance(CommandsHistory));
|
||||
|
||||
protected override readonly options: ICommandsQuickAccessOptions;
|
||||
|
||||
constructor(
|
||||
protected options: ICommandsQuickAccessOptions,
|
||||
options: ICommandsQuickAccessOptions,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
||||
@ICommandService private readonly commandService: ICommandService,
|
||||
@@ -48,6 +50,8 @@ export abstract class AbstractCommandsQuickAccessProvider extends PickerQuickAcc
|
||||
@INotificationService private readonly notificationService: INotificationService
|
||||
) {
|
||||
super(AbstractCommandsQuickAccessProvider.PREFIX, options);
|
||||
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
protected async getPicks(filter: string, disposables: DisposableStore, token: CancellationToken): Promise<Array<ICommandQuickPick | IQuickPickSeparator>> {
|
||||
|
||||
@@ -73,8 +73,8 @@ export interface IPickerQuickAccessProviderOptions<T extends IPickerQuickAccessI
|
||||
}
|
||||
|
||||
export type Pick<T> = T | IQuickPickSeparator;
|
||||
export type PicksWithActive<T> = { items: ReadonlyArray<Pick<T>>, active?: T };
|
||||
export type Picks<T> = ReadonlyArray<Pick<T>> | PicksWithActive<T>;
|
||||
export type PicksWithActive<T> = { items: readonly Pick<T>[], active?: T };
|
||||
export type Picks<T> = readonly Pick<T>[] | PicksWithActive<T>;
|
||||
export type FastAndSlowPicks<T> = { picks: Picks<T>, additionalPicks: Promise<Picks<T>> };
|
||||
|
||||
function isPicksWithActive<T>(obj: unknown): obj is PicksWithActive<T> {
|
||||
@@ -125,7 +125,7 @@ export abstract class PickerQuickAccessProvider<T extends IPickerQuickAccessItem
|
||||
const providedPicks = this.getPicks(picksFilter, picksDisposables, picksToken);
|
||||
|
||||
const applyPicks = (picks: Picks<T>, skipEmpty?: boolean): boolean => {
|
||||
let items: ReadonlyArray<Pick<T>>;
|
||||
let items: readonly Pick<T>[];
|
||||
let activeItem: T | undefined = undefined;
|
||||
|
||||
if (isPicksWithActive(picks)) {
|
||||
@@ -191,7 +191,7 @@ export abstract class PickerQuickAccessProvider<T extends IPickerQuickAccessItem
|
||||
return;
|
||||
}
|
||||
|
||||
let picks: ReadonlyArray<Pick<T>>;
|
||||
let picks: readonly Pick<T>[];
|
||||
let activePick: Pick<T> | undefined = undefined;
|
||||
if (isPicksWithActive(providedPicks.picks)) {
|
||||
picks = providedPicks.picks.items;
|
||||
@@ -200,7 +200,7 @@ export abstract class PickerQuickAccessProvider<T extends IPickerQuickAccessItem
|
||||
picks = providedPicks.picks;
|
||||
}
|
||||
|
||||
let additionalPicks: ReadonlyArray<Pick<T>>;
|
||||
let additionalPicks: readonly Pick<T>[];
|
||||
let additionalActivePick: Pick<T> | undefined = undefined;
|
||||
if (isPicksWithActive(awaitedAdditionalPicks)) {
|
||||
additionalPicks = awaitedAdditionalPicks.items;
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IQuickInputService, IQuickPick, IQuickPickItem, ItemActivation } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IQuickAccessController, IQuickAccessProvider, IQuickAccessRegistry, Extensions, IQuickAccessProviderDescriptor, IQuickAccessOptions, DefaultQuickAccessFilterValue } from 'vs/platform/quickinput/common/quickAccess';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { once } from 'vs/base/common/functional';
|
||||
|
||||
@@ -100,13 +100,27 @@ export class QuickAccessController extends Disposable implements IQuickAccessCon
|
||||
}
|
||||
|
||||
// Register listeners
|
||||
const cancellationToken = this.registerPickerListeners(picker, provider, descriptor, value, disposables);
|
||||
disposables.add(this.registerPickerListeners(picker, provider, descriptor, value));
|
||||
|
||||
// Ask provider to fill the picker as needed if we have one
|
||||
// and pass over a cancellation token that will indicate when
|
||||
// the picker is hiding without a pick being made.
|
||||
const cts = disposables.add(new CancellationTokenSource());
|
||||
if (provider) {
|
||||
disposables.add(provider.provide(picker, cancellationToken));
|
||||
disposables.add(provider.provide(picker, cts.token));
|
||||
}
|
||||
|
||||
// Finally, trigger disposal and cancellation when the picker
|
||||
// hides depending on items selected or not.
|
||||
once(picker.onDidHide)(() => {
|
||||
if (picker.selectedItems.length === 0) {
|
||||
cts.cancel();
|
||||
}
|
||||
|
||||
// Start to dispose once picker hides
|
||||
disposables.dispose();
|
||||
});
|
||||
|
||||
// Finally, show the picker. This is important because a provider
|
||||
// may not call this and then our disposables would leak that rely
|
||||
// on the onDidHide event.
|
||||
@@ -129,7 +143,8 @@ export class QuickAccessController extends Disposable implements IQuickAccessCon
|
||||
picker.valueSelection = valueSelection;
|
||||
}
|
||||
|
||||
private registerPickerListeners(picker: IQuickPick<IQuickPickItem>, provider: IQuickAccessProvider | undefined, descriptor: IQuickAccessProviderDescriptor | undefined, value: string, disposables: DisposableStore): CancellationToken {
|
||||
private registerPickerListeners(picker: IQuickPick<IQuickPickItem>, provider: IQuickAccessProvider | undefined, descriptor: IQuickAccessProviderDescriptor | undefined, value: string): IDisposable {
|
||||
const disposables = new DisposableStore();
|
||||
|
||||
// Remember as last visible picker and clean up once picker get's disposed
|
||||
const visibleQuickAccess = this.visibleQuickAccess = { picker, descriptor, value };
|
||||
@@ -157,19 +172,7 @@ export class QuickAccessController extends Disposable implements IQuickAccessCon
|
||||
}));
|
||||
}
|
||||
|
||||
// Create a cancellation token source that is valid as long as the
|
||||
// picker has not been closed without picking an item
|
||||
const cts = disposables.add(new CancellationTokenSource());
|
||||
once(picker.onDidHide)(() => {
|
||||
if (picker.selectedItems.length === 0) {
|
||||
cts.cancel();
|
||||
}
|
||||
|
||||
// Start to dispose once picker hides
|
||||
disposables.dispose();
|
||||
});
|
||||
|
||||
return cts.token;
|
||||
return disposables;
|
||||
}
|
||||
|
||||
private getOrInstantiateProvider(value: string): [IQuickAccessProvider | undefined, IQuickAccessProviderDescriptor | undefined] {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { IQuickInputService, IQuickPickItem, IPickOptions, IInputOptions, IQuick
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IThemeService, Themable } from 'vs/platform/theme/common/themeService';
|
||||
import { inputBackground, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorForeground, inputValidationErrorBorder, badgeBackground, badgeForeground, contrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, progressBarBackground, widgetShadow, listFocusForeground, listFocusBackground, activeContrastBorder, pickerGroupBorder, pickerGroupForeground, quickInputForeground, quickInputBackground, quickInputTitleBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { inputBackground, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorForeground, inputValidationErrorBorder, badgeBackground, badgeForeground, contrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, progressBarBackground, widgetShadow, listFocusForeground, activeContrastBorder, pickerGroupBorder, pickerGroupForeground, quickInputForeground, quickInputBackground, quickInputTitleBackground, quickInputListFocusBackground, keybindingLabelBackground, keybindingLabelForeground, keybindingLabelBorder, keybindingLabelBottomBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { computeStyles } from 'vs/platform/theme/common/styler';
|
||||
import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -87,7 +87,7 @@ export class QuickInputService extends Themable implements IQuickInputService {
|
||||
controller.layout(host.dimension, host.offset?.top ?? 0);
|
||||
|
||||
// Layout changes
|
||||
this._register(host.onLayout(dimension => controller.layout(dimension, host.offset?.top ?? 0)));
|
||||
this._register(host.onDidLayout(dimension => controller.layout(dimension, host.offset?.top ?? 0)));
|
||||
|
||||
// Context keys
|
||||
this._register(controller.onShow(() => this.resetContextKeys()));
|
||||
@@ -166,7 +166,7 @@ export class QuickInputService extends Themable implements IQuickInputService {
|
||||
return this.controller.cancel();
|
||||
}
|
||||
|
||||
protected updateStyles() {
|
||||
protected override updateStyles() {
|
||||
this.controller.applyStyles(this.computeStyles());
|
||||
}
|
||||
|
||||
@@ -209,11 +209,18 @@ export class QuickInputService extends Themable implements IQuickInputService {
|
||||
progressBar: computeStyles(this.theme, {
|
||||
progressBarBackground
|
||||
}),
|
||||
keybindingLabel: computeStyles(this.theme, {
|
||||
keybindingLabelBackground,
|
||||
keybindingLabelForeground,
|
||||
keybindingLabelBorder,
|
||||
keybindingLabelBottomBorder,
|
||||
keybindingLabelShadow: widgetShadow
|
||||
}),
|
||||
list: computeStyles(this.theme, {
|
||||
listBackground: quickInputBackground,
|
||||
// Look like focused when inactive.
|
||||
listInactiveFocusForeground: listFocusForeground,
|
||||
listInactiveFocusBackground: listFocusBackground,
|
||||
listInactiveFocusBackground: quickInputListFocusBackground,
|
||||
listFocusOutline: activeContrastBorder,
|
||||
listInactiveFocusOutline: activeContrastBorder,
|
||||
pickerGroupBorder,
|
||||
|
||||
Reference in New Issue
Block a user