Merge branch 'master' into sandy081/initUserData

This commit is contained in:
Sandeep Somavarapu 2020-08-19 16:29:10 +02:00
commit 116157acb1
18 changed files with 84 additions and 77 deletions

View file

@ -5737,4 +5737,4 @@
"match": "\\S+"
}
}
}
}

View file

@ -6,11 +6,11 @@
"git": {
"name": "language-php",
"repositoryUrl": "https://github.com/atom/language-php",
"commitHash": "882f6c0e19f0ebf9dafa443bf4c3fc5626f76aed"
"commitHash": "11cdaf62a9d949d3aca550f1a58c9754de6b5ab0"
}
},
"license": "MIT",
"version": "0.44.4"
"version": "0.44.5"
}
],
"version": 1

View file

@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/atom/language-php/commit/882f6c0e19f0ebf9dafa443bf4c3fc5626f76aed",
"version": "https://github.com/atom/language-php/commit/11cdaf62a9d949d3aca550f1a58c9754de6b5ab0",
"scopeName": "source.php",
"patterns": [
{
@ -146,7 +146,7 @@
"name": "keyword.other.use.php"
}
},
"end": "(?<=})|(?=;)",
"end": "(?<=})|(?=;)|(?=\\?>)",
"name": "meta.use.php",
"patterns": [
{

View file

@ -6,7 +6,7 @@
"git": {
"name": "MagicStack/MagicPython",
"repositoryUrl": "https://github.com/MagicStack/MagicPython",
"commitHash": "b4b2e6eb16fee36aea0788bf0aa1853c25f7d276"
"commitHash": "c9b3409deb69acec31bbf7913830e93a046b30cc"
}
},
"license": "MIT",

View file

@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/MagicStack/MagicPython/commit/b4b2e6eb16fee36aea0788bf0aa1853c25f7d276",
"version": "https://github.com/MagicStack/MagicPython/commit/b2b4f4ae7b4e6284e80bda8080106b93bd588f9e",
"name": "MagicPython",
"scopeName": "source.python",
"patterns": [
@ -634,9 +634,6 @@
},
"2": {
"name": "invalid.illegal.dec.python"
},
"3": {
"name": "invalid.illegal.dec.python"
}
}
},

View file

@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/textmate/swift.tmbundle/commit/ecba759c1c2f46f69795fe2d01691030214dd5ff",
"version": "https://github.com/textmate/swift.tmbundle/commit/97d29d2073853c328e42239c5d38c96e2e2ade9c",
"name": "Swift",
"scopeName": "source.swift",
"comment": "See swift.tmbundle/grammar-test.swift for test cases.",
@ -2620,7 +2620,7 @@
"name": "variable.language.swift"
},
{
"match": "\\B(?:#file|#filePath|#line|#column|#function|#dsohandle)\\b|\\b(?:__FILE__|__LINE__|__COLUMN__|__FUNCTION__|__DSO_HANDLE__)\\b",
"match": "\\B(?:#file|#filePath|#fileID|#line|#column|#function|#dsohandle)\\b|\\b(?:__FILE__|__LINE__|__COLUMN__|__FUNCTION__|__DSO_HANDLE__)\\b",
"name": "support.variable.swift"
},
{

View file

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { alert } from 'vs/base/browser/ui/aria/aria';
import { isNonEmptyArray } from 'vs/base/common/arrays';
import { asArray, isNonEmptyArray } from 'vs/base/common/arrays';
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
import { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors';
import { URI } from 'vs/base/common/uri';
@ -120,10 +120,10 @@ export abstract class FormattingConflicts {
}
}
export async function formatDocumentRangeWithSelectedProvider(
export async function formatDocumentRangesWithSelectedProvider(
accessor: ServicesAccessor,
editorOrModel: ITextModel | IActiveCodeEditor,
range: Range,
rangeOrRanges: Range | Range[],
mode: FormattingMode,
token: CancellationToken
): Promise<void> {
@ -133,15 +133,15 @@ export async function formatDocumentRangeWithSelectedProvider(
const provider = DocumentRangeFormattingEditProviderRegistry.ordered(model);
const selected = await FormattingConflicts.select(provider, model, mode);
if (selected) {
await instaService.invokeFunction(formatDocumentRangeWithProvider, selected, editorOrModel, range, token);
await instaService.invokeFunction(formatDocumentRangesWithProvider, selected, editorOrModel, rangeOrRanges, token);
}
}
export async function formatDocumentRangeWithProvider(
export async function formatDocumentRangesWithProvider(
accessor: ServicesAccessor,
provider: DocumentRangeFormattingEditProvider,
editorOrModel: ITextModel | IActiveCodeEditor,
range: Range,
rangeOrRanges: Range | Range[],
token: CancellationToken
): Promise<boolean> {
const workerService = accessor.get(IEditorWorkerService);
@ -156,39 +156,53 @@ export async function formatDocumentRangeWithProvider(
cts = new TextModelCancellationTokenSource(editorOrModel, token);
}
let edits: TextEdit[] | undefined;
try {
const rawEdits = await provider.provideDocumentRangeFormattingEdits(
model,
range,
model.getFormattingOptions(),
cts.token
);
edits = await workerService.computeMoreMinimalEdits(model.uri, rawEdits);
if (cts.token.isCancellationRequested) {
return true;
// make sure that ranges don't overlap nor touch each other
let ranges: Range[] = [];
let len = 0;
for (let range of asArray(rangeOrRanges).sort(Range.compareRangesUsingStarts)) {
if (len > 0 && Range.areIntersectingOrTouching(ranges[len - 1], range)) {
ranges[len - 1] = Range.fromPositions(ranges[len - 1].getStartPosition(), range.getEndPosition());
} else {
len = ranges.push(range);
}
} finally {
cts.dispose();
}
if (!edits || edits.length === 0) {
const allEdits: TextEdit[] = [];
for (let range of ranges) {
try {
const rawEdits = await provider.provideDocumentRangeFormattingEdits(
model,
range,
model.getFormattingOptions(),
cts.token
);
const minEdits = await workerService.computeMoreMinimalEdits(model.uri, rawEdits);
if (minEdits) {
allEdits.push(...minEdits);
}
if (cts.token.isCancellationRequested) {
return true;
}
} finally {
cts.dispose();
}
}
if (allEdits.length === 0) {
return false;
}
if (isCodeEditor(editorOrModel)) {
// use editor to apply edits
FormattingEdit.execute(editorOrModel, edits, true);
alertFormattingEdits(edits);
FormattingEdit.execute(editorOrModel, allEdits, true);
alertFormattingEdits(allEdits);
editorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), ScrollType.Immediate);
} else {
// use model to apply edits
const [{ range }] = edits;
const [{ range }] = allEdits;
const initialSelection = new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);
model.pushEditOperations([initialSelection], edits.map(edit => {
model.pushEditOperations([initialSelection], allEdits.map(edit => {
return {
text: edit.text,
range: Range.lift(edit.range),

View file

@ -16,7 +16,7 @@ import { IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { DocumentRangeFormattingEditProviderRegistry, OnTypeFormattingEditProviderRegistry } from 'vs/editor/common/modes';
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
import { getOnTypeFormattingEdits, alertFormattingEdits, formatDocumentRangeWithSelectedProvider, formatDocumentWithSelectedProvider, FormattingMode } from 'vs/editor/contrib/format/format';
import { getOnTypeFormattingEdits, alertFormattingEdits, formatDocumentRangesWithSelectedProvider, formatDocumentWithSelectedProvider, FormattingMode } from 'vs/editor/contrib/format/format';
import { FormattingEdit } from 'vs/editor/contrib/format/formattingEdit';
import * as nls from 'vs/nls';
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
@ -202,7 +202,7 @@ class FormatOnPaste implements IEditorContribution {
if (this.editor.getSelections().length > 1) {
return;
}
this._instantiationService.invokeFunction(formatDocumentRangeWithSelectedProvider, this.editor, range, FormattingMode.Silent, CancellationToken.None).catch(onUnexpectedError);
this._instantiationService.invokeFunction(formatDocumentRangesWithSelectedProvider, this.editor, range, FormattingMode.Silent, CancellationToken.None).catch(onUnexpectedError);
}
}
@ -274,7 +274,7 @@ class FormatSelectionAction extends EditorAction {
const progressService = accessor.get(IEditorProgressService);
await progressService.showWhile(
instaService.invokeFunction(formatDocumentRangeWithSelectedProvider, editor, range, FormattingMode.Explicit, CancellationToken.None),
instaService.invokeFunction(formatDocumentRangesWithSelectedProvider, editor, range, FormattingMode.Explicit, CancellationToken.None),
250
);
}

View file

@ -328,6 +328,7 @@ export abstract class AbstractSynchroniser extends Disposable {
this.logService.info(`${this.syncResourceLogLabel}: Failed to synchronize ${this.syncResourceLogLabel} as there is a new local version available. Synchronizing again...`);
return this.performSync(remoteUserData, lastSyncUserData, apply);
case UserDataSyncErrorCode.Conflict:
case UserDataSyncErrorCode.PreconditionFailed:
// Rejected as there is a new remote version. Syncing again...
this.logService.info(`${this.syncResourceLogLabel}: Failed to synchronize as there is a new remote version available. Synchronizing again...`);

View file

@ -210,6 +210,7 @@ export const HEADER_EXECUTION_ID = 'X-Execution-Id';
export enum UserDataSyncErrorCode {
// Client Errors (>= 400 )
Unauthorized = 'Unauthorized', /* 401 */
Conflict = 'Conflict', /* 409 */
Gone = 'Gone', /* 410 */
PreconditionFailed = 'PreconditionFailed', /* 412 */
TooLarge = 'TooLarge', /* 413 */

View file

@ -393,6 +393,10 @@ export class UserDataSyncStoreClient extends Disposable implements IUserDataSync
this._onTokenSucceed.fire();
if (context.res.statusCode === 409) {
throw new UserDataSyncStoreError(`${options.type} request '${options.url?.toString()}' failed because of Conflict (409). There is new data exists for this resource. Make the request again with latest data.`, UserDataSyncErrorCode.Conflict, operationId);
}
if (context.res.statusCode === 410) {
throw new UserDataSyncStoreError(`${options.type} request '${options.url?.toString()}' failed because the requested resource is not longer available (410).`, UserDataSyncErrorCode.Gone, operationId);
}

13
src/vs/vscode.d.ts vendored
View file

@ -11147,6 +11147,19 @@ declare module 'vscode' {
* Defaults to Separate.
*/
consoleMode?: DebugConsoleMode;
/**
* Controls whether this session should run without debugging, thus ignoring breakpoints.
* When this property is not specified, the value from the parent session (if there is one) is used.
*/
noDebug?: boolean;
/**
* Controls if the debug session's parent session is shown in the CALL STACK view even if it has only a single child.
* By default, the debug session will never hide its parent.
* If compact is true, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact.
*/
compact?: boolean;
}
/**

View file

@ -737,21 +737,6 @@ declare module 'vscode' {
//#region debug
export interface DebugSessionOptions {
/**
* Controls whether this session should run without debugging, thus ignoring breakpoints.
* When this property is not specified, the value from the parent session (if there is one) is used.
*/
noDebug?: boolean;
/**
* Controls if the debug session's parent session is shown in the CALL STACK view even if it has only a single child.
* By default, the debug session will never hide its parent.
* If compact is true, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact.
*/
compact?: boolean;
}
/**
* A DebugProtocolBreakpoint is an opaque stand-in type for the [Breakpoint](https://microsoft.github.io/debug-adapter-protocol/specification#Types_Breakpoint) type defined in the Debug Adapter Protocol.
*/

View file

@ -12,7 +12,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { formatDocumentRangeWithProvider, formatDocumentWithProvider, getRealAndSyntheticDocumentFormattersOrdered, FormattingConflicts, FormattingMode } from 'vs/editor/contrib/format/format';
import { formatDocumentRangesWithProvider, formatDocumentWithProvider, getRealAndSyntheticDocumentFormattersOrdered, FormattingConflicts, FormattingMode } from 'vs/editor/contrib/format/format';
import { Range } from 'vs/editor/common/core/range';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
@ -308,7 +308,7 @@ registerEditorAction(class FormatSelectionMultipleAction extends EditorAction {
const provider = DocumentRangeFormattingEditProviderRegistry.ordered(model);
const pick = await instaService.invokeFunction(showFormatterPick, model, provider);
if (typeof pick === 'number') {
await instaService.invokeFunction(formatDocumentRangeWithProvider, provider[pick], editor, range, CancellationToken.None);
await instaService.invokeFunction(formatDocumentRangesWithProvider, provider[pick], editor, range, CancellationToken.None);
}
logFormatterTelemetry(telemetryService, 'range', provider, typeof pick === 'number' && provider[pick] || undefined);

View file

@ -14,7 +14,14 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { showExtensionQuery } from 'vs/workbench/contrib/format/browser/showExtensionQuery';
import { VIEWLET_ID, IExtensionsViewPaneContainer } from 'vs/workbench/contrib/extensions/common/extensions';
async function showExtensionQuery(viewletService: IViewletService, query: string) {
const viewlet = await viewletService.openViewlet(VIEWLET_ID, true);
if (viewlet) {
(viewlet?.getViewPaneContainer() as IExtensionsViewPaneContainer).search(query);
}
}
registerEditorAction(class FormatDocumentMultipleAction extends EditorAction {

View file

@ -1,15 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { VIEWLET_ID, IExtensionsViewPaneContainer } from 'vs/workbench/contrib/extensions/common/extensions';
export function showExtensionQuery(viewletService: IViewletService, query: string) {
return viewletService.openViewlet(VIEWLET_ID, true).then(viewlet => {
if (viewlet) {
(viewlet?.getViewPaneContainer() as IExtensionsViewPaneContainer).search(query);
}
});
}

View file

@ -1528,7 +1528,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
if (this._taskSystem?.isTaskVisible(executeResult.task)) {
const message = nls.localize('TaskSystem.activeSame.noBackground', 'The task \'{0}\' is already active.', executeResult.task.getQualifiedLabel());
let lastInstance = this.getTaskSystem().getLastInstance(executeResult.task) ?? executeResult.task;
this.notificationService.prompt(Severity.Info, message,
this.notificationService.prompt(Severity.Warning, message,
[{
label: nls.localize('terminateTask', "Terminate Task"),
run: () => this.terminate(lastInstance)

View file

@ -264,7 +264,7 @@ export abstract class BaseConfigurationResolverService extends AbstractVariableR
if (!Types.isString(info.description)) {
missingAttribute('description');
}
const inputOptions: IInputOptions = { prompt: info.description };
const inputOptions: IInputOptions = { prompt: info.description, ignoreFocusLost: true };
if (info.default) {
inputOptions.value = info.default;
}
@ -310,7 +310,7 @@ export abstract class BaseConfigurationResolverService extends AbstractVariableR
picks.push(item);
}
});
const pickOptions: IPickOptions<PickStringItem> = { placeHolder: info.description, matchOnDetail: true };
const pickOptions: IPickOptions<PickStringItem> = { placeHolder: info.description, matchOnDetail: true, ignoreFocusLost: true };
return this.quickInputService.pick(picks, pickOptions, undefined).then(resolvedInput => {
if (resolvedInput) {
return resolvedInput.value;