mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-06-18 17:45:08 -04:00
Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 (#8962)
* Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 * skip failing tests * update mac build image
This commit is contained in:
committed by
Karl Burtram
parent
0eaee18dc4
commit
fefe1454de
@@ -22,7 +22,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
|
||||
import { ICommandDelegate } from 'vs/editor/browser/view/viewController';
|
||||
import { IContentWidgetData, IOverlayWidgetData, View } from 'vs/editor/browser/view/viewImpl';
|
||||
import { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents';
|
||||
import { ConfigurationChangedEvent, EditorLayoutInfo, IEditorOptions, EditorOption, IComputedEditorOptions, FindComputedEditorOptionValueById, IEditorConstructionOptions } from 'vs/editor/common/config/editorOptions';
|
||||
import { ConfigurationChangedEvent, EditorLayoutInfo, IEditorOptions, EditorOption, IComputedEditorOptions, FindComputedEditorOptionValueById, IEditorConstructionOptions, filterValidationDecorations } from 'vs/editor/common/config/editorOptions';
|
||||
import { Cursor, CursorStateChangedEvent } from 'vs/editor/common/controller/cursor';
|
||||
import { CursorColumns, ICursors } from 'vs/editor/common/controller/cursorCommon';
|
||||
import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
@@ -156,13 +156,13 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
private readonly _onDidType: Emitter<string> = this._register(new Emitter<string>());
|
||||
public readonly onDidType = this._onDidType.event;
|
||||
|
||||
private readonly _onCompositionStart: Emitter<void> = this._register(new Emitter<void>());
|
||||
public readonly onCompositionStart = this._onCompositionStart.event;
|
||||
private readonly _onDidCompositionStart: Emitter<void> = this._register(new Emitter<void>());
|
||||
public readonly onDidCompositionStart = this._onDidCompositionStart.event;
|
||||
|
||||
private readonly _onCompositionEnd: Emitter<void> = this._register(new Emitter<void>());
|
||||
public readonly onCompositionEnd = this._onCompositionEnd.event;
|
||||
private readonly _onDidCompositionEnd: Emitter<void> = this._register(new Emitter<void>());
|
||||
public readonly onDidCompositionEnd = this._onDidCompositionEnd.event;
|
||||
|
||||
private readonly _onDidPaste: Emitter<Range> = this._register(new Emitter<Range>());
|
||||
private readonly _onDidPaste: Emitter<editorBrowser.IPasteEvent> = this._register(new Emitter<editorBrowser.IPasteEvent>());
|
||||
public readonly onDidPaste = this._onDidPaste.event;
|
||||
|
||||
private readonly _onMouseUp: Emitter<editorBrowser.IEditorMouseEvent> = this._register(new Emitter<editorBrowser.IEditorMouseEvent>());
|
||||
@@ -950,19 +950,15 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
const endPosition = this._modelData.cursor.getSelection().getStartPosition();
|
||||
if (source === 'keyboard') {
|
||||
this._onDidPaste.fire(
|
||||
new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column)
|
||||
{
|
||||
range: new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column),
|
||||
mode: payload.mode
|
||||
}
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (handlerId === editorCommon.Handler.CompositionStart) {
|
||||
this._onCompositionStart.fire();
|
||||
}
|
||||
if (handlerId === editorCommon.Handler.CompositionEnd) {
|
||||
this._onCompositionEnd.fire();
|
||||
}
|
||||
|
||||
const action = this.getAction(handlerId);
|
||||
if (action) {
|
||||
Promise.resolve(action.run()).then(undefined, onUnexpectedError);
|
||||
@@ -978,6 +974,13 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
}
|
||||
|
||||
this._modelData.cursor.trigger(source, handlerId, payload);
|
||||
|
||||
if (handlerId === editorCommon.Handler.CompositionStart) {
|
||||
this._onDidCompositionStart.fire();
|
||||
}
|
||||
if (handlerId === editorCommon.Handler.CompositionEnd) {
|
||||
this._onDidCompositionEnd.fire();
|
||||
}
|
||||
}
|
||||
|
||||
private _triggerEditorCommand(source: string, handlerId: string, payload: any): boolean {
|
||||
@@ -1061,7 +1064,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
if (!this._modelData) {
|
||||
return null;
|
||||
}
|
||||
return this._modelData.model.getLineDecorations(lineNumber, this._id, this._configuration.options.get(EditorOption.readOnly));
|
||||
return this._modelData.model.getLineDecorations(lineNumber, this._id, filterValidationDecorations(this._configuration.options));
|
||||
}
|
||||
|
||||
public deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[] {
|
||||
@@ -1165,6 +1168,10 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
return this._modelData.view.createOverviewRuler(cssClassName);
|
||||
}
|
||||
|
||||
public getContainerDomNode(): HTMLElement {
|
||||
return this._domElement;
|
||||
}
|
||||
|
||||
public getDomNode(): HTMLElement | null {
|
||||
if (!this._modelData || !this._modelData.hasRealView) {
|
||||
return null;
|
||||
@@ -1441,8 +1448,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
executeEditorCommand: (editorCommand: CoreEditorCommand, args: any): void => {
|
||||
editorCommand.runCoreEditorCommand(cursor, args);
|
||||
},
|
||||
paste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null) => {
|
||||
this.trigger(source, editorCommon.Handler.Paste, { text, pasteOnNewLine, multicursorText });
|
||||
paste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null) => {
|
||||
this.trigger(source, editorCommon.Handler.Paste, { text, pasteOnNewLine, multicursorText, mode });
|
||||
},
|
||||
type: (source: string, text: string) => {
|
||||
this.trigger(source, editorCommon.Handler.Type, { text });
|
||||
@@ -1465,11 +1472,12 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
executeEditorCommand: (editorCommand: CoreEditorCommand, args: any): void => {
|
||||
editorCommand.runCoreEditorCommand(cursor, args);
|
||||
},
|
||||
paste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null) => {
|
||||
paste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null) => {
|
||||
this._commandService.executeCommand(editorCommon.Handler.Paste, {
|
||||
text: text,
|
||||
pasteOnNewLine: pasteOnNewLine,
|
||||
multicursorText: multicursorText
|
||||
multicursorText: multicursorText,
|
||||
mode
|
||||
});
|
||||
},
|
||||
type: (source: string, text: string) => {
|
||||
@@ -1548,7 +1556,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
}
|
||||
|
||||
private _registerDecorationType(key: string, options: editorCommon.IDecorationRenderOptions, parentTypeKey?: string): void {
|
||||
this._codeEditorService.registerDecorationType(key, options, parentTypeKey);
|
||||
this._codeEditorService.registerDecorationType(key, options, parentTypeKey, this);
|
||||
}
|
||||
|
||||
private _removeDecorationType(key: string): void {
|
||||
|
||||
Reference in New Issue
Block a user