mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 11:08:31 -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:
@@ -4,23 +4,19 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { InlineDecoration } from 'vs/editor/common/viewModel/viewModel';
|
||||
import { InlineDecoration, InlineDecorationType } from 'vs/editor/common/viewModel/viewModel';
|
||||
import { Constants } from 'vs/editor/common/core/uint';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
|
||||
export class LineDecoration {
|
||||
_lineDecorationBrand: void;
|
||||
|
||||
public readonly startColumn: number;
|
||||
public readonly endColumn: number;
|
||||
public readonly className: string;
|
||||
public readonly insertsBeforeOrAfter: boolean;
|
||||
|
||||
constructor(startColumn: number, endColumn: number, className: string, insertsBeforeOrAfter: boolean) {
|
||||
this.startColumn = startColumn;
|
||||
this.endColumn = endColumn;
|
||||
this.className = className;
|
||||
this.insertsBeforeOrAfter = insertsBeforeOrAfter;
|
||||
constructor(
|
||||
public readonly startColumn: number,
|
||||
public readonly endColumn: number,
|
||||
public readonly className: string,
|
||||
public readonly type: InlineDecorationType
|
||||
) {
|
||||
}
|
||||
|
||||
private static _equals(a: LineDecoration, b: LineDecoration): boolean {
|
||||
@@ -28,7 +24,7 @@ export class LineDecoration {
|
||||
a.startColumn === b.startColumn
|
||||
&& a.endColumn === b.endColumn
|
||||
&& a.className === b.className
|
||||
&& a.insertsBeforeOrAfter === b.insertsBeforeOrAfter
|
||||
&& a.type === b.type
|
||||
);
|
||||
}
|
||||
|
||||
@@ -62,7 +58,7 @@ export class LineDecoration {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (range.isEmpty()) {
|
||||
if (range.isEmpty() && d.type === InlineDecorationType.Regular) {
|
||||
// Ignore empty range decorations
|
||||
continue;
|
||||
}
|
||||
@@ -70,12 +66,7 @@ export class LineDecoration {
|
||||
let startColumn = (range.startLineNumber === lineNumber ? range.startColumn : minLineColumn);
|
||||
let endColumn = (range.endLineNumber === lineNumber ? range.endColumn : maxLineColumn);
|
||||
|
||||
if (endColumn <= 1) {
|
||||
// An empty decoration (endColumn === 1)
|
||||
continue;
|
||||
}
|
||||
|
||||
result[resultLen++] = new LineDecoration(startColumn, endColumn, d.inlineClassName, d.insertsBeforeOrAfter);
|
||||
result[resultLen++] = new LineDecoration(startColumn, endColumn, d.inlineClassName, d.type);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -48,10 +48,6 @@ export class ViewLayout extends Disposable implements IViewLayout {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
public getScrollable(): Scrollable {
|
||||
return this.scrollable;
|
||||
}
|
||||
|
||||
public onHeightMaybeChanged(): void {
|
||||
this._updateHeight();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { CharCode } from 'vs/base/common/charCode';
|
||||
import { LineDecoration, LineDecorationsNormalizer } from 'vs/editor/common/viewLayout/lineDecorations';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { IStringBuilder, createStringBuilder } from 'vs/editor/common/core/stringBuilder';
|
||||
import { InlineDecorationType } from 'vs/editor/common/viewModel/viewModel';
|
||||
|
||||
export const enum RenderWhitespace {
|
||||
None = 0,
|
||||
@@ -243,14 +244,14 @@ export function renderViewLine(input: RenderLineInput, sb: IStringBuilder): Rend
|
||||
let classNames: string[] = [];
|
||||
for (let i = 0, len = input.lineDecorations.length; i < len; i++) {
|
||||
const lineDecoration = input.lineDecorations[i];
|
||||
if (lineDecoration.insertsBeforeOrAfter) {
|
||||
classNames[i] = input.lineDecorations[i].className;
|
||||
if (lineDecoration.type !== InlineDecorationType.Regular) {
|
||||
classNames.push(input.lineDecorations[i].className);
|
||||
containsForeignElements = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (containsForeignElements) {
|
||||
content = `<span><span class="${classNames.join(' ')}">\u00a0</span></span>`;
|
||||
content = `<span><span class="${classNames.join(' ')}"></span></span>`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +323,7 @@ function resolveRenderLineInput(input: RenderLineInput): ResolvedRenderLineInput
|
||||
if (input.lineDecorations.length > 0) {
|
||||
for (let i = 0, len = input.lineDecorations.length; i < len; i++) {
|
||||
const lineDecoration = input.lineDecorations[i];
|
||||
if (lineDecoration.insertsBeforeOrAfter) {
|
||||
if (lineDecoration.type !== InlineDecorationType.Regular) {
|
||||
containsForeignElements = true;
|
||||
break;
|
||||
}
|
||||
@@ -568,6 +569,16 @@ function _applyInlineDecorations(lineContent: string, len: number, tokens: LineP
|
||||
}
|
||||
}
|
||||
|
||||
const lastTokenEndIndex = tokens[tokens.length - 1].endIndex;
|
||||
if (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {
|
||||
let classNames: string[] = [];
|
||||
while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {
|
||||
classNames.push(lineDecorations[lineDecorationIndex].className);
|
||||
lineDecorationIndex++;
|
||||
}
|
||||
result[resultLen++] = new LinePart(lastResultEndIndex, classNames.join(' '));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -618,7 +629,6 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render
|
||||
{
|
||||
let _charIndex = charIndex;
|
||||
let _tabsCharDelta = tabsCharDelta;
|
||||
let _charOffsetInPart = charOffsetInPart;
|
||||
|
||||
for (; _charIndex < partEndIndex; _charIndex++) {
|
||||
const charCode = lineContent.charCodeAt(_charIndex);
|
||||
@@ -626,13 +636,10 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render
|
||||
if (charCode === CharCode.Tab) {
|
||||
let insertSpacesCount = tabSize - (_charIndex + _tabsCharDelta) % tabSize;
|
||||
_tabsCharDelta += insertSpacesCount - 1;
|
||||
_charOffsetInPart += insertSpacesCount - 1;
|
||||
partContentCnt += insertSpacesCount;
|
||||
} else {
|
||||
partContentCnt++;
|
||||
}
|
||||
|
||||
_charOffsetInPart++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user