mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -16,7 +16,6 @@ import { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common
|
||||
export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
|
||||
private _context: ViewContext;
|
||||
private _lineHeight: number;
|
||||
private _readOnly: boolean;
|
||||
private _renderLineHighlight: 'none' | 'gutter' | 'line' | 'all';
|
||||
private _selectionIsEmpty: boolean;
|
||||
private _primaryCursorIsInEditableRange: boolean;
|
||||
@@ -28,7 +27,6 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
|
||||
super();
|
||||
this._context = context;
|
||||
this._lineHeight = this._context.configuration.editor.lineHeight;
|
||||
this._readOnly = this._context.configuration.editor.readOnly;
|
||||
this._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight;
|
||||
|
||||
this._selectionIsEmpty = true;
|
||||
@@ -52,9 +50,6 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
|
||||
if (e.lineHeight) {
|
||||
this._lineHeight = this._context.configuration.editor.lineHeight;
|
||||
}
|
||||
if (e.readOnly) {
|
||||
this._readOnly = this._context.configuration.editor.readOnly;
|
||||
}
|
||||
if (e.viewInfo) {
|
||||
this._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/v
|
||||
import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';
|
||||
import { getThemeTypeSelector } from 'vs/platform/theme/common/themeService';
|
||||
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
|
||||
import { ISimplifiedMouseEvent } from 'vs/base/browser/ui/scrollbar/abstractScrollbar';
|
||||
|
||||
export class EditorScrollbar extends ViewPart {
|
||||
|
||||
@@ -89,6 +88,7 @@ export class EditorScrollbar extends ViewPart {
|
||||
this._register(dom.addDisposableListener(viewDomNode.domNode, 'scroll', (e: Event) => onBrowserDesperateReveal(viewDomNode.domNode, true, true)));
|
||||
this._register(dom.addDisposableListener(linesContent.domNode, 'scroll', (e: Event) => onBrowserDesperateReveal(linesContent.domNode, true, false)));
|
||||
this._register(dom.addDisposableListener(overflowGuardDomNode.domNode, 'scroll', (e: Event) => onBrowserDesperateReveal(overflowGuardDomNode.domNode, true, false)));
|
||||
this._register(dom.addDisposableListener(this.scrollbarDomNode.domNode, 'scroll', (e: Event) => onBrowserDesperateReveal(this.scrollbarDomNode.domNode, true, false)));
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
@@ -115,10 +115,6 @@ export class EditorScrollbar extends ViewPart {
|
||||
this.scrollbar.delegateVerticalScrollbarMouseDown(browserEvent);
|
||||
}
|
||||
|
||||
public delegateSliderMouseDown(e: ISimplifiedMouseEvent, onDragFinished: () => void): void {
|
||||
this.scrollbar.delegateSliderMouseDown(e, onDragFinished);
|
||||
}
|
||||
|
||||
// --- begin event handlers
|
||||
|
||||
public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
|
||||
@@ -14,20 +14,19 @@ import { ViewContext } from 'vs/editor/common/view/viewContext';
|
||||
import { RenderingContext } from 'vs/editor/common/view/renderingContext';
|
||||
import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { RenderLineNumbersType } from 'vs/editor/common/config/editorOptions';
|
||||
|
||||
export class LineNumbersOverlay extends DynamicViewOverlay {
|
||||
|
||||
public static CLASS_NAME = 'line-numbers';
|
||||
public static readonly CLASS_NAME = 'line-numbers';
|
||||
|
||||
private _context: ViewContext;
|
||||
|
||||
private _lineHeight: number;
|
||||
private _renderLineNumbers: boolean;
|
||||
private _renderLineNumbers: RenderLineNumbersType;
|
||||
private _renderCustomLineNumbers: (lineNumber: number) => string;
|
||||
private _renderRelativeLineNumbers: boolean;
|
||||
private _lineNumbersLeft: number;
|
||||
private _lineNumbersWidth: number;
|
||||
|
||||
private _lastCursorModelPosition: Position;
|
||||
private _renderResult: string[];
|
||||
|
||||
@@ -47,7 +46,6 @@ export class LineNumbersOverlay extends DynamicViewOverlay {
|
||||
this._lineHeight = config.lineHeight;
|
||||
this._renderLineNumbers = config.viewInfo.renderLineNumbers;
|
||||
this._renderCustomLineNumbers = config.viewInfo.renderCustomLineNumbers;
|
||||
this._renderRelativeLineNumbers = config.viewInfo.renderRelativeLineNumbers;
|
||||
this._lineNumbersLeft = config.layoutInfo.lineNumbersLeft;
|
||||
this._lineNumbersWidth = config.layoutInfo.lineNumbersWidth;
|
||||
}
|
||||
@@ -69,7 +67,7 @@ export class LineNumbersOverlay extends DynamicViewOverlay {
|
||||
const primaryViewPosition = e.selections[0].getPosition();
|
||||
this._lastCursorModelPosition = this._context.model.coordinatesConverter.convertViewPositionToModelPosition(primaryViewPosition);
|
||||
|
||||
if (this._renderRelativeLineNumbers) {
|
||||
if (this._renderLineNumbers === RenderLineNumbersType.Relative || this._renderLineNumbers === RenderLineNumbersType.Interval) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -106,7 +104,7 @@ export class LineNumbersOverlay extends DynamicViewOverlay {
|
||||
return this._renderCustomLineNumbers(modelLineNumber);
|
||||
}
|
||||
|
||||
if (this._renderRelativeLineNumbers) {
|
||||
if (this._renderLineNumbers === RenderLineNumbersType.Relative) {
|
||||
let diff = Math.abs(this._lastCursorModelPosition.lineNumber - modelLineNumber);
|
||||
if (diff === 0) {
|
||||
return '<span class="relative-current-line-number">' + modelLineNumber + '</span>';
|
||||
@@ -114,11 +112,21 @@ export class LineNumbersOverlay extends DynamicViewOverlay {
|
||||
return String(diff);
|
||||
}
|
||||
|
||||
if (this._renderLineNumbers === RenderLineNumbersType.Interval) {
|
||||
if (this._lastCursorModelPosition.lineNumber === modelLineNumber) {
|
||||
return String(modelLineNumber);
|
||||
}
|
||||
if (modelLineNumber % 10 === 0) {
|
||||
return String(modelLineNumber);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
return String(modelLineNumber);
|
||||
}
|
||||
|
||||
public prepareRender(ctx: RenderingContext): void {
|
||||
if (!this._renderLineNumbers) {
|
||||
if (this._renderLineNumbers === RenderLineNumbersType.Off) {
|
||||
this._renderResult = null;
|
||||
return;
|
||||
}
|
||||
@@ -133,6 +141,7 @@ export class LineNumbersOverlay extends DynamicViewOverlay {
|
||||
let lineIndex = lineNumber - visibleStartLineNumber;
|
||||
|
||||
let renderLineNumber = this._getLineRenderLineNumber(lineNumber);
|
||||
|
||||
if (renderLineNumber) {
|
||||
output[lineIndex] = (
|
||||
common
|
||||
@@ -166,4 +175,4 @@ registerThemingParticipant((theme, collector) => {
|
||||
if (lineNumbers) {
|
||||
collector.addRule(`.monaco-editor .line-numbers { color: ${lineNumbers}; }`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import { HorizontalRange } from 'vs/editor/common/view/renderingContext';
|
||||
import { Constants } from 'vs/editor/common/core/uint';
|
||||
|
||||
class FloatHorizontalRange {
|
||||
_floatHorizontalRangeBrand: void;
|
||||
@@ -133,6 +134,18 @@ export class RangeUtil {
|
||||
let startElement = domNode.children[startChildIndex].firstChild;
|
||||
let endElement = domNode.children[endChildIndex].firstChild;
|
||||
|
||||
if (!startElement || !endElement) {
|
||||
// When having an empty <span> (without any text content), try to move to the previous <span>
|
||||
if (!startElement && startOffset === 0 && startChildIndex > 0) {
|
||||
startElement = domNode.children[startChildIndex - 1].firstChild;
|
||||
startOffset = Constants.MAX_SAFE_SMALL_INTEGER;
|
||||
}
|
||||
if (!endElement && endOffset === 0 && endChildIndex > 0) {
|
||||
endElement = domNode.children[endChildIndex - 1].firstChild;
|
||||
endOffset = Constants.MAX_SAFE_SMALL_INTEGER;
|
||||
}
|
||||
}
|
||||
|
||||
if (!startElement || !endElement) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import { HorizontalRange } from 'vs/editor/common/view/renderingContext';
|
||||
import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';
|
||||
import { ThemeType, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';
|
||||
import { IStringBuilder } from 'vs/editor/common/core/stringBuilder';
|
||||
import { InlineDecorationType } from 'vs/editor/common/viewModel/viewModel';
|
||||
|
||||
const canUseFastRenderedViewLine = (function () {
|
||||
if (platform.isNative) {
|
||||
@@ -108,7 +109,7 @@ export class ViewLineOptions {
|
||||
|
||||
export class ViewLine implements IVisibleLine {
|
||||
|
||||
public static CLASS_NAME = 'view-line';
|
||||
public static readonly CLASS_NAME = 'view-line';
|
||||
|
||||
private _options: ViewLineOptions;
|
||||
private _isMaybeInvalid: boolean;
|
||||
@@ -183,7 +184,7 @@ export class ViewLine implements IVisibleLine {
|
||||
let endColumn = (selection.endLineNumber === lineNumber ? selection.endColumn : lineData.maxColumn);
|
||||
|
||||
if (startColumn < endColumn) {
|
||||
actualInlineDecorations.push(new LineDecoration(startColumn, endColumn, 'inline-selected-text', false));
|
||||
actualInlineDecorations.push(new LineDecoration(startColumn, endColumn, 'inline-selected-text', InlineDecorationType.Regular));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
|
||||
/**
|
||||
* Adds this ammount of pixels to the right of lines (no-one wants to type near the edge of the viewport)
|
||||
*/
|
||||
private static HORIZONTAL_EXTRA_PX = 30;
|
||||
private static readonly HORIZONTAL_EXTRA_PX = 30;
|
||||
|
||||
private readonly _linesContent: FastDomNode<HTMLElement>;
|
||||
private readonly _textRangeRestingSpot: HTMLElement;
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
||||
|
||||
export class Margin extends ViewPart {
|
||||
|
||||
public static CLASS_NAME = 'glyph-margin';
|
||||
public static readonly CLASS_NAME = 'glyph-margin';
|
||||
|
||||
private _domNode: FastDomNode<HTMLElement>;
|
||||
private _canUseLayerHinting: boolean;
|
||||
|
||||
@@ -290,7 +290,7 @@ class MinimapLayout {
|
||||
|
||||
class MinimapLine implements ILine {
|
||||
|
||||
public static INVALID = new MinimapLine(-1);
|
||||
public static readonly INVALID = new MinimapLine(-1);
|
||||
|
||||
dy: number;
|
||||
|
||||
@@ -439,8 +439,6 @@ export class Minimap extends ViewPart {
|
||||
private readonly _sliderMouseMoveMonitor: GlobalMouseMoveMonitor<IStandardMouseMoveEventData>;
|
||||
private readonly _sliderMouseDownListener: IDisposable;
|
||||
|
||||
private readonly _minimapCharRenderer: MinimapCharRenderer;
|
||||
|
||||
private _options: MinimapOptions;
|
||||
private _lastRenderData: RenderData;
|
||||
private _buffers: MinimapBuffers;
|
||||
@@ -482,8 +480,6 @@ export class Minimap extends ViewPart {
|
||||
|
||||
this._tokensColorTracker = MinimapTokensColorTracker.getInstance();
|
||||
|
||||
this._minimapCharRenderer = getOrCreateMinimapCharRenderer();
|
||||
|
||||
this._applyLayout();
|
||||
|
||||
this._mouseDownListener = dom.addStandardDisposableListener(this._canvas.domNode, 'mousedown', (e) => {
|
||||
@@ -734,7 +730,7 @@ export class Minimap extends ViewPart {
|
||||
useLighterFont,
|
||||
renderMinimap,
|
||||
this._tokensColorTracker,
|
||||
this._minimapCharRenderer,
|
||||
getOrCreateMinimapCharRenderer(),
|
||||
dy,
|
||||
tabSize,
|
||||
lineInfo.data[lineIndex]
|
||||
|
||||
@@ -258,6 +258,7 @@ export class DecorationsOverviewRuler extends ViewPart {
|
||||
for (let i = 0, len = e.selections.length; i < len; i++) {
|
||||
this._cursorPositions[i] = e.selections[i].getPosition();
|
||||
}
|
||||
this._cursorPositions.sort(Position.compare);
|
||||
return true;
|
||||
}
|
||||
public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {
|
||||
@@ -418,4 +419,3 @@ export class DecorationsOverviewRuler extends ViewPart {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ export class Rulers extends ViewPart {
|
||||
public domNode: FastDomNode<HTMLElement>;
|
||||
private _renderedRulers: FastDomNode<HTMLElement>[];
|
||||
private _rulers: number[];
|
||||
private _height: number;
|
||||
private _typicalHalfwidthCharacterWidth: number;
|
||||
|
||||
constructor(context: ViewContext) {
|
||||
@@ -31,7 +30,6 @@ export class Rulers extends ViewPart {
|
||||
this.domNode.setClassName('view-rulers');
|
||||
this._renderedRulers = [];
|
||||
this._rulers = this._context.configuration.editor.viewInfo.rulers;
|
||||
this._height = this._context.configuration.editor.layoutInfo.contentHeight;
|
||||
this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;
|
||||
}
|
||||
|
||||
@@ -44,7 +42,6 @@ export class Rulers extends ViewPart {
|
||||
public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
if (e.viewInfo || e.layoutInfo || e.fontInfo) {
|
||||
this._rulers = this._context.configuration.editor.viewInfo.rulers;
|
||||
this._height = this._context.configuration.editor.layoutInfo.contentHeight;
|
||||
this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -66,14 +66,14 @@ const isIEWithZoomingIssuesNearRoundedBorders = browser.isEdgeOrIE;
|
||||
|
||||
export class SelectionsOverlay extends DynamicViewOverlay {
|
||||
|
||||
private static SELECTION_CLASS_NAME = 'selected-text';
|
||||
private static SELECTION_TOP_LEFT = 'top-left-radius';
|
||||
private static SELECTION_BOTTOM_LEFT = 'bottom-left-radius';
|
||||
private static SELECTION_TOP_RIGHT = 'top-right-radius';
|
||||
private static SELECTION_BOTTOM_RIGHT = 'bottom-right-radius';
|
||||
private static EDITOR_BACKGROUND_CLASS_NAME = 'monaco-editor-background';
|
||||
private static readonly SELECTION_CLASS_NAME = 'selected-text';
|
||||
private static readonly SELECTION_TOP_LEFT = 'top-left-radius';
|
||||
private static readonly SELECTION_BOTTOM_LEFT = 'bottom-left-radius';
|
||||
private static readonly SELECTION_TOP_RIGHT = 'top-right-radius';
|
||||
private static readonly SELECTION_BOTTOM_RIGHT = 'bottom-right-radius';
|
||||
private static readonly EDITOR_BACKGROUND_CLASS_NAME = 'monaco-editor-background';
|
||||
|
||||
private static ROUNDED_PIECE_WIDTH = 10;
|
||||
private static readonly ROUNDED_PIECE_WIDTH = 10;
|
||||
|
||||
private _context: ViewContext;
|
||||
private _lineHeight: number;
|
||||
|
||||
@@ -192,10 +192,6 @@ export class ViewCursors extends ViewPart {
|
||||
|
||||
// --- end event handlers
|
||||
|
||||
public getPosition(): Position {
|
||||
return this._primaryCursor.getPosition();
|
||||
}
|
||||
|
||||
// ---- blinking logic
|
||||
|
||||
private _getCursorBlinking(): TextEditorCursorBlinkingStyle {
|
||||
@@ -365,4 +361,4 @@ registerThemingParticipant((theme, collector) => {
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,10 +22,6 @@ export interface IMyViewZone {
|
||||
marginDomNode: FastDomNode<HTMLElement>;
|
||||
}
|
||||
|
||||
export interface IMyRenderData {
|
||||
data: IViewWhitespaceViewportData[];
|
||||
}
|
||||
|
||||
interface IComputedViewZoneProps {
|
||||
afterViewLineNumber: number;
|
||||
heightInPx: number;
|
||||
|
||||
Reference in New Issue
Block a user