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:
Karl Burtram
2018-01-28 23:37:17 -08:00
committed by GitHub
parent 9a1ac20710
commit 251ae01c3e
8009 changed files with 93378 additions and 35634 deletions

View File

@@ -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;

View File

@@ -48,10 +48,6 @@ export class ViewLayout extends Disposable implements IViewLayout {
super.dispose();
}
public getScrollable(): Scrollable {
return this.scrollable;
}
public onHeightMaybeChanged(): void {
this._updateHeight();
}

View File

@@ -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++;
}
}