Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 (#7404)

* Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421

* readd svgs
This commit is contained in:
Anthony Dresser
2019-09-27 11:13:19 -07:00
committed by GitHub
parent 6385443a4c
commit 07109617b5
348 changed files with 4219 additions and 4307 deletions

View File

@@ -14,4 +14,7 @@
*/
.monaco-editor .margin-view-overlays .cgmr {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
}

View File

@@ -1405,7 +1405,7 @@ export interface IWebviewPanelOptions {
/**
* @internal
*/
export const enum WebviewEditorState {
export const enum WebviewContentState {
Readonly = 1,
Unchanged = 2,
Dirty = 3,

View File

@@ -95,7 +95,7 @@ export class MarkerDecorationsService extends Disposable implements IMarkerDecor
return markerDecorations ? markerDecorations.getMarkers() : [];
}
private _handleMarkerChange(changedResources: URI[]): void {
private _handleMarkerChange(changedResources: readonly URI[]): void {
changedResources.forEach((resource) => {
const markerDecorations = this._markerDecorations.get(MODEL_ID(resource));
if (markerDecorations) {

View File

@@ -18,6 +18,7 @@ import { IEditorProgressService } from 'vs/platform/progress/common/progress';
import { getCodeActions, CodeActionSet } from './codeAction';
import { CodeActionTrigger } from './codeActionTrigger';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
import { isEqual } from 'vs/base/common/resources';
export const SUPPORTED_CODE_ACTIONS = new RawContextKey<string>('supportedCodeAction', '');
@@ -47,13 +48,13 @@ class CodeActionOracle extends Disposable {
return this._createEventAndSignalChange(trigger, selection);
}
private _onMarkerChanges(resources: URI[]): void {
private _onMarkerChanges(resources: readonly URI[]): void {
const model = this._editor.getModel();
if (!model) {
return;
}
if (resources.some(resource => resource.toString() === model.uri.toString())) {
if (resources.some(resource => isEqual(resource, model.uri))) {
this._autoTriggerTimer.cancelAndSet(() => {
this.trigger({ type: 'auto' });
}, this._delay);

View File

@@ -3,7 +3,8 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .margin-view-overlays .codicon {
.monaco-editor .margin-view-overlays .codicon-chevron-right,
.monaco-editor .margin-view-overlays .codicon-chevron-down {
cursor: pointer;
opacity: 0;
transition: opacity 0.5s;

View File

@@ -29,6 +29,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import { CancellationToken } from 'vs/base/common/cancellation';
import { Disposable } from 'vs/base/common/lifecycle';
import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async';
import { withNullAsUndefined } from 'vs/base/common/types';
class RenameSkeleton {
@@ -45,15 +46,15 @@ class RenameSkeleton {
return this._providers.length > 0;
}
async resolveRenameLocation(token: CancellationToken): Promise<RenameLocation & Rejection | null | undefined> {
async resolveRenameLocation(token: CancellationToken): Promise<RenameLocation & Rejection | undefined> {
const firstProvider = this._providers[0];
if (!firstProvider) {
return undefined;
}
let res: RenameLocation & Rejection | null | undefined;
let res: RenameLocation & Rejection | undefined;
if (firstProvider.resolveRenameLocation) {
res = await firstProvider.resolveRenameLocation(this.model, this.position, token);
res = withNullAsUndefined(await firstProvider.resolveRenameLocation(this.model, this.position, token));
}
if (!res) {
@@ -160,7 +161,7 @@ class RenameController extends Disposable implements IEditorContribution {
return undefined;
}
let loc: RenameLocation & Rejection | null | undefined;
let loc: RenameLocation & Rejection | undefined;
try {
const resolveLocationOperation = skeleton.resolveRenameLocation(token);
this._progressService.showWhile(resolveLocationOperation, 250);
@@ -254,6 +255,8 @@ class RenameController extends Disposable implements IEditorContribution {
if (this._activeRename) {
this._activeRename.operation.cancel();
this._activeRename = undefined;
this.cancelRenameInput();
}
}
}

View File

@@ -11,7 +11,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { onUnexpectedError } from 'vs/base/common/errors';
import { IDisposable, dispose, toDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle';
import { addClass, append, $, hide, removeClass, show, toggleClass, getDomNodePagePosition, hasClass, addDisposableListener, addStandardDisposableListener } from 'vs/base/browser/dom';
import { IListVirtualDelegate, IListEvent, IListRenderer, IListMouseEvent } from 'vs/base/browser/ui/list/list';
import { IListVirtualDelegate, IListEvent, IListRenderer, IListMouseEvent, IListGestureEvent } from 'vs/base/browser/ui/list/list';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
@@ -524,7 +524,8 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
}));
this.toDispose.add(themeService.onThemeChange(t => this.onThemeChange(t)));
this.toDispose.add(editor.onDidLayoutChange(() => this.onEditorLayoutChange()));
this.toDispose.add(this.list.onMouseDown(e => this.onListMouseDown(e)));
this.toDispose.add(this.list.onMouseDown(e => this.onListMouseDownOrTap(e)));
this.toDispose.add(this.list.onTap(e => this.onListMouseDownOrTap(e)));
this.toDispose.add(this.list.onSelectionChange(e => this.onListSelection(e)));
this.toDispose.add(this.list.onFocusChange(e => this.onListFocus(e)));
this.toDispose.add(this.editor.onDidChangeCursorSelection(() => this.onCursorSelectionChanged()));
@@ -572,7 +573,7 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
}
}
private onListMouseDown(e: IListMouseEvent<CompletionItem>): void {
private onListMouseDownOrTap(e: IListMouseEvent<CompletionItem> | IListGestureEvent<CompletionItem>): void {
if (typeof e.element === 'undefined' || typeof e.index === 'undefined') {
return;
}