mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 17:23:15 -05:00
Merge from vscode dbe62be3266ffb6772a7f3db0bf61d63f4aa7f65 (#9337)
This commit is contained in:
@@ -130,7 +130,7 @@ export interface IExtensionContributions {
|
||||
views?: { [location: string]: IView[] };
|
||||
colors?: IColor[];
|
||||
localizations?: ILocalization[];
|
||||
readonly webviewEditors?: readonly IWebviewEditor[];
|
||||
readonly customEditors?: readonly IWebviewEditor[];
|
||||
readonly codeActions?: readonly ICodeActionContribution[];
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,10 @@ export abstract class AbstractKeybindingService extends Disposable implements IK
|
||||
private _currentChordChecker: IntervalTimer;
|
||||
private _currentChordStatusMessage: IDisposable | null;
|
||||
|
||||
public get inChordMode(): boolean {
|
||||
return !!this._currentChord;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private _contextKeyService: IContextKeyService,
|
||||
protected _commandService: ICommandService,
|
||||
|
||||
@@ -50,6 +50,8 @@ export const IKeybindingService = createDecorator<IKeybindingService>('keybindin
|
||||
export interface IKeybindingService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
readonly inChordMode: boolean;
|
||||
|
||||
onDidUpdateKeybindings: Event<IKeybindingEvent>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,10 @@ import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKe
|
||||
import { keys } from 'vs/base/common/map';
|
||||
|
||||
export interface IResolveResult {
|
||||
/** Whether the resolved keybinding is entering a chord */
|
||||
enterChord: boolean;
|
||||
/** Whether the resolved keybinding is leaving (and executing) a chord */
|
||||
leaveChord: boolean;
|
||||
commandId: string | null;
|
||||
commandArgs: any;
|
||||
bubble: boolean;
|
||||
@@ -285,6 +288,7 @@ export class KeybindingResolver {
|
||||
if (currentChord === null && result.keypressParts.length > 1 && result.keypressParts[1] !== null) {
|
||||
return {
|
||||
enterChord: true,
|
||||
leaveChord: false,
|
||||
commandId: null,
|
||||
commandArgs: null,
|
||||
bubble: false
|
||||
@@ -293,6 +297,7 @@ export class KeybindingResolver {
|
||||
|
||||
return {
|
||||
enterChord: false,
|
||||
leaveChord: result.keypressParts.length > 1,
|
||||
commandId: result.command,
|
||||
commandArgs: result.commandArgs,
|
||||
bubble: result.bubble
|
||||
|
||||
@@ -71,6 +71,8 @@ export class MockContextKeyService implements IContextKeyService {
|
||||
export class MockKeybindingService implements IKeybindingService {
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public readonly inChordMode: boolean = false;
|
||||
|
||||
public get onDidUpdateKeybindings(): Event<IKeybindingEvent> {
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ if (isWeb) {
|
||||
// Running out of sources
|
||||
if (Object.keys(product).length === 0) {
|
||||
assign(product, {
|
||||
version: '1.41.0-dev',
|
||||
vscodeVersion: '1.39.0-dev',
|
||||
nameLong: 'Visual Studio Code Web Dev',
|
||||
nameShort: 'VSCode Web Dev',
|
||||
urlProtocol: 'code-oss'
|
||||
version: '1.16.0-dev',
|
||||
vscodeVersion: '1.43.0-dev',
|
||||
nameLong: 'Azure Data Studio Web Dev',
|
||||
nameShort: 'Azure Data Studio Web Dev',
|
||||
urlProtocol: 'azuredatastudio-oss'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { values } from 'vs/base/common/map';
|
||||
import { IStringDictionary } from 'vs/base/common/collections';
|
||||
import { FormattingOptions, Edit, getEOL } from 'vs/base/common/jsonFormatter';
|
||||
import * as contentUtil from 'vs/platform/userDataSync/common/content';
|
||||
import { IConflictSetting } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { IConflictSetting, getDisallowedIgnoredSettings } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { firstIndex, distinct } from 'vs/base/common/arrays';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { startsWith } from 'vs/base/common/strings';
|
||||
@@ -32,7 +32,7 @@ export function getIgnoredSettings(defaultIgnoredSettings: string[], configurati
|
||||
} else {
|
||||
value = configurationService.getValue<string[]>('sync.ignoredSettings');
|
||||
}
|
||||
const added: string[] = [], removed: string[] = [];
|
||||
const added: string[] = [], removed: string[] = [...getDisallowedIgnoredSettings()];
|
||||
if (Array.isArray(value)) {
|
||||
for (const key of value) {
|
||||
if (startsWith(key, '-')) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { isEqual, joinPath } from 'vs/base/common/resources';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { distinct } from 'vs/base/common/arrays';
|
||||
|
||||
export const CONFIGURATION_SYNC_STORE_KEY = 'configurationSync.store';
|
||||
|
||||
@@ -37,10 +38,16 @@ export interface ISyncConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
export function getDisallowedIgnoredSettings(): string[] {
|
||||
const allSettings = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).getConfigurationProperties();
|
||||
return Object.keys(allSettings).filter(setting => !!allSettings[setting].disallowSyncIgnore);
|
||||
}
|
||||
|
||||
export function getDefaultIgnoredSettings(): string[] {
|
||||
const allSettings = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).getConfigurationProperties();
|
||||
const machineSettings = Object.keys(allSettings).filter(setting => allSettings[setting].scope === ConfigurationScope.MACHINE || allSettings[setting].scope === ConfigurationScope.MACHINE_OVERRIDABLE);
|
||||
return [CONFIGURATION_SYNC_STORE_KEY, ...machineSettings];
|
||||
const disallowedSettings = getDisallowedIgnoredSettings();
|
||||
return distinct([CONFIGURATION_SYNC_STORE_KEY, ...machineSettings, ...disallowedSettings]);
|
||||
}
|
||||
|
||||
export function registerConfiguration(): IDisposable {
|
||||
@@ -53,36 +60,6 @@ export function registerConfiguration(): IDisposable {
|
||||
title: localize('sync', "Sync"),
|
||||
type: 'object',
|
||||
properties: {
|
||||
'sync.enable': {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
scope: ConfigurationScope.APPLICATION,
|
||||
deprecationMessage: 'deprecated'
|
||||
},
|
||||
'sync.enableSettings': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
scope: ConfigurationScope.APPLICATION,
|
||||
deprecationMessage: 'deprecated'
|
||||
},
|
||||
'sync.enableKeybindings': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
scope: ConfigurationScope.APPLICATION,
|
||||
deprecationMessage: 'Deprecated'
|
||||
},
|
||||
'sync.enableUIState': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
scope: ConfigurationScope.APPLICATION,
|
||||
deprecationMessage: 'deprecated'
|
||||
},
|
||||
'sync.enableExtensions': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
scope: ConfigurationScope.APPLICATION,
|
||||
deprecationMessage: 'deprecated'
|
||||
},
|
||||
'sync.keybindingsPerPlatform': {
|
||||
type: 'boolean',
|
||||
description: localize('sync.keybindingsPerPlatform', "Synchronize keybindings per platform."),
|
||||
@@ -115,11 +92,15 @@ export function registerConfiguration(): IDisposable {
|
||||
});
|
||||
const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
|
||||
const registerIgnoredSettingsSchema = () => {
|
||||
const defaultIgnoreSettings = getDefaultIgnoredSettings().filter(s => s !== CONFIGURATION_SYNC_STORE_KEY);
|
||||
const disallowedIgnoredSettings = getDisallowedIgnoredSettings();
|
||||
const defaultIgnoredSettings = getDefaultIgnoredSettings().filter(s => s !== CONFIGURATION_SYNC_STORE_KEY);
|
||||
const settings = Object.keys(allSettings.properties).filter(setting => defaultIgnoredSettings.indexOf(setting) === -1);
|
||||
const ignoredSettings = defaultIgnoredSettings.filter(setting => disallowedIgnoredSettings.indexOf(setting) === -1);
|
||||
console.log(ignoredSettings);
|
||||
const ignoredSettingsSchema: IJSONSchema = {
|
||||
items: {
|
||||
type: 'string',
|
||||
enum: [...Object.keys(allSettings.properties).filter(setting => defaultIgnoreSettings.indexOf(setting) === -1), ...defaultIgnoreSettings.map(setting => `-${setting}`)]
|
||||
enum: [...settings, ...ignoredSettings.map(setting => `-${setting}`)]
|
||||
},
|
||||
};
|
||||
jsonRegistry.registerSchema(ignoredSettingsSchemaId, ignoredSettingsSchema);
|
||||
|
||||
Reference in New Issue
Block a user