Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -173,4 +173,60 @@ suite('CursorMove', () => {
testColumnFromVisibleColumn('📚az', 4, 3, 4);
testColumnFromVisibleColumn('📚az', 4, 4, 5);
});
});
test('toStatusbarColumn', () => {
function t(text: string, tabSize: number, column: number, expected: number): void {
assert.equal(CursorColumns.toStatusbarColumn(text, column, tabSize), expected, `<<t('${text}', ${tabSize}, ${column}, ${expected})>>`);
}
t(' spaces', 4, 1, 1);
t(' spaces', 4, 2, 2);
t(' spaces', 4, 3, 3);
t(' spaces', 4, 4, 4);
t(' spaces', 4, 5, 5);
t(' spaces', 4, 6, 6);
t(' spaces', 4, 7, 7);
t(' spaces', 4, 8, 8);
t(' spaces', 4, 9, 9);
t(' spaces', 4, 10, 10);
t(' spaces', 4, 11, 11);
t('\ttab', 4, 1, 1);
t('\ttab', 4, 2, 5);
t('\ttab', 4, 3, 6);
t('\ttab', 4, 4, 7);
t('\ttab', 4, 5, 8);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 1, 1);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 2, 2);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 3, 2);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 4, 3);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 5, 3);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 6, 4);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 7, 4);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 8, 5);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 9, 5);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 10, 6);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 11, 6);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 12, 7);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 13, 7);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 14, 8);
t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 15, 8);
t('🎈🎈🎈🎈', 4, 1, 1);
t('🎈🎈🎈🎈', 4, 2, 2);
t('🎈🎈🎈🎈', 4, 3, 2);
t('🎈🎈🎈🎈', 4, 4, 3);
t('🎈🎈🎈🎈', 4, 5, 3);
t('🎈🎈🎈🎈', 4, 6, 4);
t('🎈🎈🎈🎈', 4, 7, 4);
t('🎈🎈🎈🎈', 4, 8, 5);
t('🎈🎈🎈🎈', 4, 9, 5);
t('何何何何', 4, 1, 1);
t('何何何何', 4, 2, 2);
t('何何何何', 4, 3, 3);
t('何何何何', 4, 4, 4);
});
});

View File

@@ -87,9 +87,9 @@ suite('Editor Core - Range', () => {
b = new Range(1, 1, 1, 4);
assert.ok(Range.compareRangesUsingEnds(a, b) > 0, 'a.start = b.start, a.end > b.end');
a = new Range(1, 1, 5, 1);
a = new Range(1, 2, 5, 1);
b = new Range(1, 1, 1, 4);
assert.ok(Range.compareRangesUsingEnds(a, b) > 0, 'a.start = b.start, a.end > b.end');
assert.ok(Range.compareRangesUsingEnds(a, b) > 0, 'a.start > b.start, a.end > b.end');
});
test('containsPosition', () => {

View File

@@ -55,9 +55,10 @@ function assertDiff(originalLines: string[], modifiedLines: string[], expectedCh
shouldComputeCharChanges,
shouldPostProcessCharChanges,
shouldIgnoreTrimWhitespace,
shouldMakePrettyDiff: true
shouldMakePrettyDiff: true,
maxComputationTime: 0
});
let changes = diffComputer.computeDiff();
let changes = diffComputer.computeDiff().changes;
let extracted: IChange[] = [];
for (let i = 0; i < changes.length; i++) {

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { CommonEditorConfiguration, IEnvConfiguration } from 'vs/editor/common/config/commonEditorConfig';
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
import { IEditorOptions, EditorFontLigatures } from 'vs/editor/common/config/editorOptions';
import { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo';
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
@@ -33,6 +33,7 @@ export class TestConfiguration extends CommonEditorConfiguration {
fontFamily: 'mockFont',
fontWeight: 'normal',
fontSize: 14,
fontFeatureSettings: EditorFontLigatures.OFF,
lineHeight: 19,
letterSpacing: 1.5,
isMonospace: true,

View File

@@ -721,6 +721,20 @@ suite('TextModelSearch', () => {
);
});
test('issue #65281. \w should match line break.', () => {
assertFindMatches(
[
'this/is{',
'a test',
'}',
].join('\n'),
'this/\\w*[^}]*', true, false, null,
[
[1, 1, 3, 1]
]
);
});
test('Simple find using unicode escape sequences', () => {
assertFindMatches(
regularText.join('\n'),

View File

@@ -25,8 +25,8 @@ suite('TextModelWithTokens', () => {
}
return {
range: a.range.toString(),
open: a.open,
close: a.close,
open: a.open[0],
close: a.close[0],
isOpen: a.isOpen
};
}
@@ -57,8 +57,8 @@ suite('TextModelWithTokens', () => {
let ch = lineText.charAt(charIndex);
if (charIsBracket[ch]) {
expectedBrackets.push({
open: openForChar[ch],
close: closeForChar[ch],
open: [openForChar[ch]],
close: [closeForChar[ch]],
isOpen: charIsOpenBracket[ch],
range: new Range(lineIndex + 1, charIndex + 1, lineIndex + 1, charIndex + 2)
});
@@ -145,18 +145,18 @@ suite('TextModelWithTokens', () => {
});
});
function assertIsNotBracket(model: TextModel, lineNumber: number, column: number) {
const match = model.matchBracket(new Position(lineNumber, column));
assert.equal(match, null, 'is not matching brackets at ' + lineNumber + ', ' + column);
}
function assertIsBracket(model: TextModel, testPosition: Position, expected: [Range, Range]): void {
const actual = model.matchBracket(testPosition);
assert.deepEqual(actual, expected, 'matches brackets at ' + testPosition);
}
suite('TextModelWithTokens - bracket matching', () => {
function isNotABracket(model: TextModel, lineNumber: number, column: number) {
let match = model.matchBracket(new Position(lineNumber, column));
assert.equal(match, null, 'is not matching brackets at ' + lineNumber + ', ' + column);
}
function isBracket2(model: TextModel, testPosition: Position, expected: [Range, Range]): void {
let actual = model.matchBracket(testPosition);
assert.deepEqual(actual, expected, 'matches brackets at ' + testPosition);
}
const languageIdentifier = new LanguageIdentifier('bracketMode1', LanguageId.PlainText);
let registration: IDisposable;
@@ -180,21 +180,21 @@ suite('TextModelWithTokens - bracket matching', () => {
')]}{[(';
let model = TextModel.createFromString(text, undefined, languageIdentifier);
isNotABracket(model, 1, 1);
isNotABracket(model, 1, 2);
isNotABracket(model, 1, 3);
isBracket2(model, new Position(1, 4), [new Range(1, 4, 1, 5), new Range(2, 3, 2, 4)]);
isBracket2(model, new Position(1, 5), [new Range(1, 5, 1, 6), new Range(2, 2, 2, 3)]);
isBracket2(model, new Position(1, 6), [new Range(1, 6, 1, 7), new Range(2, 1, 2, 2)]);
isBracket2(model, new Position(1, 7), [new Range(1, 6, 1, 7), new Range(2, 1, 2, 2)]);
assertIsNotBracket(model, 1, 1);
assertIsNotBracket(model, 1, 2);
assertIsNotBracket(model, 1, 3);
assertIsBracket(model, new Position(1, 4), [new Range(1, 4, 1, 5), new Range(2, 3, 2, 4)]);
assertIsBracket(model, new Position(1, 5), [new Range(1, 5, 1, 6), new Range(2, 2, 2, 3)]);
assertIsBracket(model, new Position(1, 6), [new Range(1, 6, 1, 7), new Range(2, 1, 2, 2)]);
assertIsBracket(model, new Position(1, 7), [new Range(1, 6, 1, 7), new Range(2, 1, 2, 2)]);
isBracket2(model, new Position(2, 1), [new Range(2, 1, 2, 2), new Range(1, 6, 1, 7)]);
isBracket2(model, new Position(2, 2), [new Range(2, 2, 2, 3), new Range(1, 5, 1, 6)]);
isBracket2(model, new Position(2, 3), [new Range(2, 3, 2, 4), new Range(1, 4, 1, 5)]);
isBracket2(model, new Position(2, 4), [new Range(2, 3, 2, 4), new Range(1, 4, 1, 5)]);
isNotABracket(model, 2, 5);
isNotABracket(model, 2, 6);
isNotABracket(model, 2, 7);
assertIsBracket(model, new Position(2, 1), [new Range(2, 1, 2, 2), new Range(1, 6, 1, 7)]);
assertIsBracket(model, new Position(2, 2), [new Range(2, 2, 2, 3), new Range(1, 5, 1, 6)]);
assertIsBracket(model, new Position(2, 3), [new Range(2, 3, 2, 4), new Range(1, 4, 1, 5)]);
assertIsBracket(model, new Position(2, 4), [new Range(2, 3, 2, 4), new Range(1, 4, 1, 5)]);
assertIsNotBracket(model, 2, 5);
assertIsNotBracket(model, 2, 6);
assertIsNotBracket(model, 2, 7);
model.dispose();
});
@@ -238,7 +238,7 @@ suite('TextModelWithTokens - bracket matching', () => {
let isABracket: { [lineNumber: number]: { [col: number]: boolean; }; } = { 1: {}, 2: {}, 3: {}, 4: {}, 5: {} };
for (let i = 0, len = brackets.length; i < len; i++) {
let [testPos, b1, b2] = brackets[i];
isBracket2(model, testPos, [b1, b2]);
assertIsBracket(model, testPos, [b1, b2]);
isABracket[testPos.lineNumber][testPos.column] = true;
}
@@ -246,7 +246,7 @@ suite('TextModelWithTokens - bracket matching', () => {
let line = model.getLineContent(i);
for (let j = 1, lenJ = line.length + 1; j <= lenJ; j++) {
if (!isABracket[i].hasOwnProperty(<any>j)) {
isNotABracket(model, i, j);
assertIsNotBracket(model, i, j);
}
}
}
@@ -255,6 +255,88 @@ suite('TextModelWithTokens - bracket matching', () => {
});
});
suite('TextModelWithTokens', () => {
test('bracket matching 3', () => {
const languageIdentifier = new LanguageIdentifier('bracketMode2', LanguageId.PlainText);
const registration = LanguageConfigurationRegistry.register(languageIdentifier, {
brackets: [
['if', 'end if'],
['loop', 'end loop'],
['begin', 'end']
],
});
const text = [
'begin',
' loop',
' if then',
' end if;',
' end loop;',
'end;',
'',
'begin',
' loop',
' if then',
' end ifa;',
' end loop;',
'end;',
].join('\n');
const model = TextModel.createFromString(text, undefined, languageIdentifier);
// <if> ... <end ifa> is not matched
assertIsNotBracket(model, 10, 9);
// <if> ... <end if> is matched
assertIsBracket(model, new Position(3, 9), [new Range(3, 9, 3, 11), new Range(4, 9, 4, 15)]);
assertIsBracket(model, new Position(4, 9), [new Range(4, 9, 4, 15), new Range(3, 9, 3, 11)]);
// <loop> ... <end loop> is matched
assertIsBracket(model, new Position(2, 5), [new Range(2, 5, 2, 9), new Range(5, 5, 5, 13)]);
assertIsBracket(model, new Position(5, 5), [new Range(5, 5, 5, 13), new Range(2, 5, 2, 9)]);
// <begin> ... <end> is matched
assertIsBracket(model, new Position(1, 1), [new Range(1, 1, 1, 6), new Range(6, 1, 6, 4)]);
assertIsBracket(model, new Position(6, 1), [new Range(6, 1, 6, 4), new Range(1, 1, 1, 6)]);
model.dispose();
registration.dispose();
});
test('bracket matching 4', () => {
const languageIdentifier = new LanguageIdentifier('bracketMode2', LanguageId.PlainText);
const registration = LanguageConfigurationRegistry.register(languageIdentifier, {
brackets: [
['recordbegin', 'endrecord'],
['simplerecordbegin', 'endrecord'],
],
});
const text = [
'recordbegin',
' simplerecordbegin',
' endrecord',
'endrecord',
].join('\n');
const model = TextModel.createFromString(text, undefined, languageIdentifier);
// <recordbegin> ... <endrecord> is matched
assertIsBracket(model, new Position(1, 1), [new Range(1, 1, 1, 12), new Range(4, 1, 4, 10)]);
assertIsBracket(model, new Position(4, 1), [new Range(4, 1, 4, 10), new Range(1, 1, 1, 12)]);
// <simplerecordbegin> ... <endrecord> is matched
assertIsBracket(model, new Position(2, 3), [new Range(2, 3, 2, 20), new Range(3, 3, 3, 12)]);
assertIsBracket(model, new Position(3, 3), [new Range(3, 3, 3, 12), new Range(2, 3, 2, 20)]);
model.dispose();
registration.dispose();
});
});
suite('TextModelWithTokens regression tests', () => {

View File

@@ -8,6 +8,7 @@ import { StandardTokenType } from 'vs/editor/common/modes';
import { CharacterPairSupport } from 'vs/editor/common/modes/supports/characterPair';
import { TokenText, createFakeScopedLineTokens } from 'vs/editor/test/common/modesTestUtils';
import { StandardAutoClosingPairConditional } from 'vs/editor/common/modes/languageConfiguration';
import { find } from 'vs/base/common/arrays';
suite('CharacterPairSupport', () => {
@@ -53,13 +54,8 @@ suite('CharacterPairSupport', () => {
assert.deepEqual(characaterPairSupport.getSurroundingPairs(), []);
});
function findAutoClosingPair(characterPairSupport: CharacterPairSupport, character: string): StandardAutoClosingPairConditional | null {
for (const autoClosingPair of characterPairSupport.getAutoClosingPairs()) {
if (autoClosingPair.open === character) {
return autoClosingPair;
}
}
return null;
function findAutoClosingPair(characterPairSupport: CharacterPairSupport, character: string): StandardAutoClosingPairConditional | undefined {
return find(characterPairSupport.getAutoClosingPairs(), autoClosingPair => autoClosingPair.open === character);
}
function testShouldAutoClose(characterPairSupport: CharacterPairSupport, line: TokenText[], character: string, column: number): boolean {

View File

@@ -9,71 +9,71 @@ import { BracketsUtils } from 'vs/editor/common/modes/supports/richEditBrackets'
suite('richEditBrackets', () => {
function findPrevBracketInToken(reversedBracketRegex: RegExp, lineText: string, currentTokenStart: number, currentTokenEnd: number): Range | null {
return BracketsUtils.findPrevBracketInToken(reversedBracketRegex, 1, lineText, currentTokenStart, currentTokenEnd);
function findPrevBracketInRange(reversedBracketRegex: RegExp, lineText: string, currentTokenStart: number, currentTokenEnd: number): Range | null {
return BracketsUtils.findPrevBracketInRange(reversedBracketRegex, 1, lineText, currentTokenStart, currentTokenEnd);
}
function findNextBracketInToken(forwardBracketRegex: RegExp, lineText: string, currentTokenStart: number, currentTokenEnd: number): Range | null {
return BracketsUtils.findNextBracketInToken(forwardBracketRegex, 1, lineText, currentTokenStart, currentTokenEnd);
function findNextBracketInRange(forwardBracketRegex: RegExp, lineText: string, currentTokenStart: number, currentTokenEnd: number): Range | null {
return BracketsUtils.findNextBracketInRange(forwardBracketRegex, 1, lineText, currentTokenStart, currentTokenEnd);
}
test('findPrevBracketInToken one char 1', () => {
let result = findPrevBracketInToken(/(\{)|(\})/i, '{', 0, 1);
let result = findPrevBracketInRange(/(\{)|(\})/i, '{', 0, 1);
assert.equal(result!.startColumn, 1);
assert.equal(result!.endColumn, 2);
});
test('findPrevBracketInToken one char 2', () => {
let result = findPrevBracketInToken(/(\{)|(\})/i, '{{', 0, 1);
let result = findPrevBracketInRange(/(\{)|(\})/i, '{{', 0, 1);
assert.equal(result!.startColumn, 1);
assert.equal(result!.endColumn, 2);
});
test('findPrevBracketInToken one char 3', () => {
let result = findPrevBracketInToken(/(\{)|(\})/i, '{hello world!', 0, 13);
let result = findPrevBracketInRange(/(\{)|(\})/i, '{hello world!', 0, 13);
assert.equal(result!.startColumn, 1);
assert.equal(result!.endColumn, 2);
});
test('findPrevBracketInToken more chars 1', () => {
let result = findPrevBracketInToken(/(olleh)/i, 'hello world!', 0, 12);
let result = findPrevBracketInRange(/(olleh)/i, 'hello world!', 0, 12);
assert.equal(result!.startColumn, 1);
assert.equal(result!.endColumn, 6);
});
test('findPrevBracketInToken more chars 2', () => {
let result = findPrevBracketInToken(/(olleh)/i, 'hello world!', 0, 5);
let result = findPrevBracketInRange(/(olleh)/i, 'hello world!', 0, 5);
assert.equal(result!.startColumn, 1);
assert.equal(result!.endColumn, 6);
});
test('findPrevBracketInToken more chars 3', () => {
let result = findPrevBracketInToken(/(olleh)/i, ' hello world!', 0, 6);
let result = findPrevBracketInRange(/(olleh)/i, ' hello world!', 0, 6);
assert.equal(result!.startColumn, 2);
assert.equal(result!.endColumn, 7);
});
test('findNextBracketInToken one char', () => {
let result = findNextBracketInToken(/(\{)|(\})/i, '{', 0, 1);
let result = findNextBracketInRange(/(\{)|(\})/i, '{', 0, 1);
assert.equal(result!.startColumn, 1);
assert.equal(result!.endColumn, 2);
});
test('findNextBracketInToken more chars', () => {
let result = findNextBracketInToken(/(world)/i, 'hello world!', 0, 12);
let result = findNextBracketInRange(/(world)/i, 'hello world!', 0, 12);
assert.equal(result!.startColumn, 7);
assert.equal(result!.endColumn, 12);
});
test('findNextBracketInToken with emoty result', () => {
let result = findNextBracketInToken(/(\{)|(\})/i, '', 0, 0);
let result = findNextBracketInRange(/(\{)|(\})/i, '', 0, 0);
assert.equal(result, null);
});
test('issue #3894: [Handlebars] Curly braces edit issues', () => {
let result = findPrevBracketInToken(/(\-\-!<)|(>\-\-)|(\{\{)|(\}\})/i, '{{asd}}', 0, 2);
let result = findPrevBracketInRange(/(\-\-!<)|(>\-\-)|(\{\{)|(\}\})/i, '{{asd}}', 0, 2);
assert.equal(result!.startColumn, 1);
assert.equal(result!.endColumn, 3);
});
});
});

View File

@@ -105,7 +105,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
const colorMap = [null!, '#000000', '#ffffff', '#ff0000', '#00ff00', '#0000ff'];
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 17, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 17, 4, true),
[
'<div>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
@@ -118,7 +118,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 12, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 12, 4, true),
[
'<div>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
@@ -131,7 +131,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 11, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 11, 4, true),
[
'<div>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">Ciao</span>',
@@ -143,7 +143,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 1, 11, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 1, 11, 4, true),
[
'<div>',
'<span style="color: #ff0000;font-style: italic;font-weight: bold;">iao</span>',
@@ -155,7 +155,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 4, 11, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 4, 11, 4, true),
[
'<div>',
'<span style="color: #000000;">&nbsp;</span>',
@@ -166,7 +166,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 5, 11, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 5, 11, 4, true),
[
'<div>',
'<span style="color: #00ff00;">hello</span>',
@@ -176,7 +176,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 5, 10, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 5, 10, 4, true),
[
'<div>',
'<span style="color: #00ff00;">hello</span>',
@@ -185,7 +185,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 6, 9, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 6, 9, 4, true),
[
'<div>',
'<span style="color: #00ff00;">ell</span>',
@@ -238,7 +238,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
const colorMap = [null!, '#000000', '#ffffff', '#ff0000', '#00ff00', '#0000ff'];
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 21, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 21, 4, true),
[
'<div>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',
@@ -252,7 +252,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 17, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 17, 4, true),
[
'<div>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',
@@ -266,7 +266,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
);
assert.equal(
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 3, 4),
tokenizeLineToHTML(text, lineTokens, colorMap, 0, 3, 4, true),
[
'<div>',
'<span style="color: #000000;">&nbsp;&nbsp;</span>',

View File

@@ -365,7 +365,7 @@ assertComputeEdits(file1, file2);
}
}
class TestTextResourcePropertiesService implements ITextResourcePropertiesService {
export class TestTextResourcePropertiesService implements ITextResourcePropertiesService {
_serviceBrand: undefined;
@@ -375,11 +375,9 @@ class TestTextResourcePropertiesService implements ITextResourcePropertiesServic
}
getEOL(resource: URI, language?: string): string {
const filesConfiguration = this.configurationService.getValue<{ eol: string }>('files', { overrideIdentifier: language, resource });
if (filesConfiguration && filesConfiguration.eol) {
if (filesConfiguration.eol !== 'auto') {
return filesConfiguration.eol;
}
const eol = this.configurationService.getValue<string>('files.eol', { overrideIdentifier: language, resource });
if (eol && eol !== 'auto') {
return eol;
}
return (platform.isLinux || platform.isMacintosh) ? '\n' : '\r\n';
}

View File

@@ -1,185 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { RGBA8 } from 'vs/editor/common/core/rgba';
import { Constants } from 'vs/editor/common/view/minimapCharRenderer';
import { getOrCreateMinimapCharRenderer } from 'vs/editor/common/view/runtimeMinimapCharRenderer';
import { MinimapCharRendererFactory } from 'vs/editor/test/common/view/minimapCharRendererFactory';
suite('MinimapCharRenderer', () => {
let sampleData: Uint8ClampedArray | null = null;
suiteSetup(() => {
sampleData = new Uint8ClampedArray(Constants.SAMPLED_CHAR_HEIGHT * Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT * Constants.CHAR_COUNT);
});
suiteTeardown(() => {
sampleData = null;
});
setup(() => {
for (let i = 0; i < sampleData!.length; i++) {
sampleData![i] = 0;
}
});
const sampleD = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0D, 0xFF, 0xFF, 0xFF, 0xA3, 0xFF, 0xFF, 0xFF, 0xF3, 0xFF, 0xFF, 0xFF, 0xE5, 0xFF, 0xFF, 0xFF, 0x5E, 0xFF, 0xFF, 0xFF, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0x10, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x94, 0xFF, 0xFF, 0xFF, 0x02, 0xFF, 0xFF, 0xFF, 0x6A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0x3B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xD6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0x31, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0x0E, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x69, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xB9, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0E, 0xFF, 0xFF, 0xFF, 0xA7, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0xE8, 0xFF, 0xFF, 0xFF, 0x71, 0xFF, 0xFF, 0xFF, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
function setSampleData(charCode: number, data: number[]) {
const rowWidth = Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT * Constants.CHAR_COUNT;
let chIndex = charCode - Constants.START_CH_CODE;
let globalOutputOffset = chIndex * Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT;
let inputOffset = 0;
for (let i = 0; i < Constants.SAMPLED_CHAR_HEIGHT; i++) {
let outputOffset = globalOutputOffset;
for (let j = 0; j < Constants.SAMPLED_CHAR_WIDTH; j++) {
for (let channel = 0; channel < Constants.RGBA_CHANNELS_CNT; channel++) {
sampleData![outputOffset] = data[inputOffset];
inputOffset++;
outputOffset++;
}
}
globalOutputOffset += rowWidth;
}
}
function createFakeImageData(width: number, height: number): ImageData {
return {
width: width,
height: height,
data: new Uint8ClampedArray(width * height * Constants.RGBA_CHANNELS_CNT)
};
}
test('letter d @ 2x', () => {
setSampleData('d'.charCodeAt(0), sampleD);
let renderer = MinimapCharRendererFactory.create(sampleData!);
let background = new RGBA8(0, 0, 0, 255);
let color = new RGBA8(255, 255, 255, 255);
let imageData = createFakeImageData(Constants.x2_CHAR_WIDTH, Constants.x2_CHAR_HEIGHT);
// set the background color
for (let i = 0, len = imageData.data.length / 4; i < len; i++) {
imageData.data[4 * i + 0] = background.r;
imageData.data[4 * i + 1] = background.g;
imageData.data[4 * i + 2] = background.b;
imageData.data[4 * i + 3] = 255;
}
renderer.x2RenderChar(imageData, 0, 0, 'd'.charCodeAt(0), color, background, false);
let actual: number[] = [];
for (let i = 0; i < imageData.data.length; i++) {
actual[i] = imageData.data[i];
}
assert.deepEqual(actual, [
0x00, 0x00, 0x00, 0xFF, 0x6D, 0x6D, 0x6D, 0xFF,
0xBB, 0xBB, 0xBB, 0xFF, 0xBE, 0xBE, 0xBE, 0xFF,
0x94, 0x94, 0x94, 0xFF, 0x7E, 0x7E, 0x7E, 0xFF,
0xB1, 0xB1, 0xB1, 0xFF, 0xBB, 0xBB, 0xBB, 0xFF,
]);
});
test('letter d @ 2x at runtime', () => {
let renderer = getOrCreateMinimapCharRenderer();
let background = new RGBA8(0, 0, 0, 255);
let color = new RGBA8(255, 255, 255, 255);
let imageData = createFakeImageData(Constants.x2_CHAR_WIDTH, Constants.x2_CHAR_HEIGHT);
// set the background color
for (let i = 0, len = imageData.data.length / 4; i < len; i++) {
imageData.data[4 * i + 0] = background.r;
imageData.data[4 * i + 1] = background.g;
imageData.data[4 * i + 2] = background.b;
imageData.data[4 * i + 3] = 255;
}
renderer.x2RenderChar(imageData, 0, 0, 'd'.charCodeAt(0), color, background, false);
let actual: number[] = [];
for (let i = 0; i < imageData.data.length; i++) {
actual[i] = imageData.data[i];
}
assert.deepEqual(actual, [
0x00, 0x00, 0x00, 0xFF, 0x6D, 0x6D, 0x6D, 0xFF,
0xBB, 0xBB, 0xBB, 0xFF, 0xBE, 0xBE, 0xBE, 0xFF,
0x94, 0x94, 0x94, 0xFF, 0x7E, 0x7E, 0x7E, 0xFF,
0xB1, 0xB1, 0xB1, 0xFF, 0xBB, 0xBB, 0xBB, 0xFF,
]);
});
test('letter d @ 1x', () => {
setSampleData('d'.charCodeAt(0), sampleD);
let renderer = MinimapCharRendererFactory.create(sampleData!);
let background = new RGBA8(0, 0, 0, 255);
let color = new RGBA8(255, 255, 255, 255);
let imageData = createFakeImageData(Constants.x1_CHAR_WIDTH, Constants.x1_CHAR_HEIGHT);
// set the background color
for (let i = 0, len = imageData.data.length / 4; i < len; i++) {
imageData.data[4 * i + 0] = background.r;
imageData.data[4 * i + 1] = background.g;
imageData.data[4 * i + 2] = background.b;
imageData.data[4 * i + 3] = 255;
}
renderer.x1RenderChar(imageData, 0, 0, 'd'.charCodeAt(0), color, background, false);
let actual: number[] = [];
for (let i = 0; i < imageData.data.length; i++) {
actual[i] = imageData.data[i];
}
assert.deepEqual(actual, [
0x55, 0x55, 0x55, 0xFF,
0x93, 0x93, 0x93, 0xFF,
]);
});
test('letter d @ 1x at runtime', () => {
let renderer = getOrCreateMinimapCharRenderer();
let background = new RGBA8(0, 0, 0, 255);
let color = new RGBA8(255, 255, 255, 255);
let imageData = createFakeImageData(Constants.x1_CHAR_WIDTH, Constants.x1_CHAR_HEIGHT);
// set the background color
for (let i = 0, len = imageData.data.length / 4; i < len; i++) {
imageData.data[4 * i + 0] = background.r;
imageData.data[4 * i + 1] = background.g;
imageData.data[4 * i + 2] = background.b;
imageData.data[4 * i + 3] = 255;
}
renderer.x1RenderChar(imageData, 0, 0, 'd'.charCodeAt(0), color, background, false);
let actual: number[] = [];
for (let i = 0; i < imageData.data.length; i++) {
actual[i] = imageData.data[i];
}
assert.deepEqual(actual, [
0x55, 0x55, 0x55, 0xFF,
0x93, 0x93, 0x93, 0xFF,
]);
});
});

View File

@@ -1,172 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Constants, MinimapCharRenderer } from 'vs/editor/common/view/minimapCharRenderer';
const enum InternalConstants {
CA_CHANNELS_CNT = 2,
}
export class MinimapCharRendererFactory {
public static create(source: Uint8ClampedArray): MinimapCharRenderer {
const expectedLength = (Constants.SAMPLED_CHAR_HEIGHT * Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT * Constants.CHAR_COUNT);
if (source.length !== expectedLength) {
throw new Error('Unexpected source in MinimapCharRenderer');
}
let x2CharData = this.toGrayscale(MinimapCharRendererFactory._downsample2x(source));
let x1CharData = this.toGrayscale(MinimapCharRendererFactory._downsample1x(source));
return new MinimapCharRenderer(x2CharData, x1CharData);
}
private static toGrayscale(charData: Uint8ClampedArray): Uint8ClampedArray {
let newLength = charData.length / 2;
let result = new Uint8ClampedArray(newLength);
let sourceOffset = 0;
for (let i = 0; i < newLength; i++) {
let color = charData[sourceOffset];
let alpha = charData[sourceOffset + 1];
let newColor = Math.round((color * alpha) / 255);
result[i] = newColor;
sourceOffset += 2;
}
return result;
}
private static _extractSampledChar(source: Uint8ClampedArray, charIndex: number, dest: Uint8ClampedArray) {
let destOffset = 0;
for (let i = 0; i < Constants.SAMPLED_CHAR_HEIGHT; i++) {
let sourceOffset = (
Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT * Constants.CHAR_COUNT * i
+ Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT * charIndex
);
for (let j = 0; j < Constants.SAMPLED_CHAR_WIDTH; j++) {
for (let c = 0; c < Constants.RGBA_CHANNELS_CNT; c++) {
dest[destOffset] = source[sourceOffset];
sourceOffset++;
destOffset++;
}
}
}
}
private static _downsample2xChar(source: Uint8ClampedArray, dest: Uint8ClampedArray): void {
// chars are 2 x 4px (width x height)
const resultLen = Constants.x2_CHAR_HEIGHT * Constants.x2_CHAR_WIDTH * InternalConstants.CA_CHANNELS_CNT;
const result = new Uint16Array(resultLen);
for (let i = 0; i < resultLen; i++) {
result[i] = 0;
}
let inputOffset = 0, globalOutputOffset = 0;
for (let i = 0; i < Constants.SAMPLED_CHAR_HEIGHT; i++) {
let outputOffset = globalOutputOffset;
let color = 0;
let alpha = 0;
for (let j = 0; j < Constants.SAMPLED_HALF_CHAR_WIDTH; j++) {
color += source[inputOffset]; // R
alpha += source[inputOffset + 3]; // A
inputOffset += Constants.RGBA_CHANNELS_CNT;
}
result[outputOffset] += color;
result[outputOffset + 1] += alpha;
outputOffset += InternalConstants.CA_CHANNELS_CNT;
color = 0;
alpha = 0;
for (let j = 0; j < Constants.SAMPLED_HALF_CHAR_WIDTH; j++) {
color += source[inputOffset]; // R
alpha += source[inputOffset + 3]; // A
inputOffset += Constants.RGBA_CHANNELS_CNT;
}
result[outputOffset] += color;
result[outputOffset + 1] += alpha;
outputOffset += InternalConstants.CA_CHANNELS_CNT;
if (i === 2 || i === 5 || i === 8) {
globalOutputOffset = outputOffset;
}
}
for (let i = 0; i < resultLen; i++) {
dest[i] = result[i] / 12; // 15 it should be
}
}
private static _downsample2x(data: Uint8ClampedArray): Uint8ClampedArray {
const resultLen = Constants.x2_CHAR_HEIGHT * Constants.x2_CHAR_WIDTH * InternalConstants.CA_CHANNELS_CNT * Constants.CHAR_COUNT;
const result = new Uint8ClampedArray(resultLen);
const sampledChar = new Uint8ClampedArray(Constants.SAMPLED_CHAR_HEIGHT * Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT);
const downsampledChar = new Uint8ClampedArray(Constants.x2_CHAR_HEIGHT * Constants.x2_CHAR_WIDTH * InternalConstants.CA_CHANNELS_CNT);
for (let charIndex = 0; charIndex < Constants.CHAR_COUNT; charIndex++) {
this._extractSampledChar(data, charIndex, sampledChar);
this._downsample2xChar(sampledChar, downsampledChar);
let resultOffset = (Constants.x2_CHAR_HEIGHT * Constants.x2_CHAR_WIDTH * InternalConstants.CA_CHANNELS_CNT * charIndex);
for (let i = 0; i < downsampledChar.length; i++) {
result[resultOffset + i] = downsampledChar[i];
}
}
return result;
}
private static _downsample1xChar(source: Uint8ClampedArray, dest: Uint8ClampedArray): void {
// chars are 1 x 2px (width x height)
const resultLen = Constants.x1_CHAR_HEIGHT * Constants.x1_CHAR_WIDTH * InternalConstants.CA_CHANNELS_CNT;
const result = new Uint16Array(resultLen);
for (let i = 0; i < resultLen; i++) {
result[i] = 0;
}
let inputOffset = 0, globalOutputOffset = 0;
for (let i = 0; i < Constants.SAMPLED_CHAR_HEIGHT; i++) {
let outputOffset = globalOutputOffset;
let color = 0;
let alpha = 0;
for (let j = 0; j < Constants.SAMPLED_CHAR_WIDTH; j++) {
color += source[inputOffset]; // R
alpha += source[inputOffset + 3]; // A
inputOffset += Constants.RGBA_CHANNELS_CNT;
}
result[outputOffset] += color;
result[outputOffset + 1] += alpha;
outputOffset += InternalConstants.CA_CHANNELS_CNT;
if (i === 5) {
globalOutputOffset = outputOffset;
}
}
for (let i = 0; i < resultLen; i++) {
dest[i] = result[i] / 50; // 60 it should be
}
}
private static _downsample1x(data: Uint8ClampedArray): Uint8ClampedArray {
const resultLen = Constants.x1_CHAR_HEIGHT * Constants.x1_CHAR_WIDTH * InternalConstants.CA_CHANNELS_CNT * Constants.CHAR_COUNT;
const result = new Uint8ClampedArray(resultLen);
const sampledChar = new Uint8ClampedArray(Constants.SAMPLED_CHAR_HEIGHT * Constants.SAMPLED_CHAR_WIDTH * Constants.RGBA_CHANNELS_CNT);
const downsampledChar = new Uint8ClampedArray(Constants.x1_CHAR_HEIGHT * Constants.x1_CHAR_WIDTH * InternalConstants.CA_CHANNELS_CNT);
for (let charIndex = 0; charIndex < Constants.CHAR_COUNT; charIndex++) {
this._extractSampledChar(data, charIndex, sampledChar);
this._downsample1xChar(sampledChar, downsampledChar);
let resultOffset = (Constants.x1_CHAR_HEIGHT * Constants.x1_CHAR_WIDTH * InternalConstants.CA_CHANNELS_CNT * charIndex);
for (let i = 0; i < downsampledChar.length; i++) {
result[resultOffset + i] = downsampledChar[i];
}
}
return result;
}
}

View File

@@ -48,7 +48,8 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
side: input.minimapSide,
renderCharacters: input.minimapRenderCharacters,
maxColumn: input.minimapMaxColumn,
showSlider: 'mouseover'
showSlider: 'mouseover',
scale: 1,
};
options._write(EditorOption.minimap, minimapOptions);
const scrollbarOptions: InternalEditorScrollbarOptions = {
@@ -704,7 +705,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
contentWidth: 901,
contentHeight: 800,
renderMinimap: RenderMinimap.Small,
renderMinimap: RenderMinimap.Text,
minimapLeft: 911,
minimapWidth: 89,
viewportColumn: 89,
@@ -762,7 +763,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
contentWidth: 901,
contentHeight: 800,
renderMinimap: RenderMinimap.Large,
renderMinimap: RenderMinimap.Text,
minimapLeft: 911,
minimapWidth: 89,
viewportColumn: 89,
@@ -820,7 +821,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
contentWidth: 943,
contentHeight: 800,
renderMinimap: RenderMinimap.Large,
renderMinimap: RenderMinimap.Text,
minimapLeft: 953,
minimapWidth: 47,
viewportColumn: 94,
@@ -878,7 +879,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
contentWidth: 943,
contentHeight: 800,
renderMinimap: RenderMinimap.Large,
renderMinimap: RenderMinimap.Text,
minimapLeft: 0,
minimapWidth: 47,
viewportColumn: 94,
@@ -936,7 +937,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
contentWidth: 1026,
contentHeight: 422,
renderMinimap: RenderMinimap.Large,
renderMinimap: RenderMinimap.Text,
minimapLeft: 1104,
minimapWidth: 83,
viewportColumn: 83,

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { toUint32Array } from 'vs/editor/common/core/uint';
import { toUint32Array } from 'vs/base/common/uint';
import { PrefixSumComputer, PrefixSumIndexOfResult } from 'vs/editor/common/viewModel/prefixSumComputer';
suite('Editor ViewModel - PrefixSumComputer', () => {

View File

@@ -9,7 +9,7 @@ import { IViewLineTokens } from 'vs/editor/common/core/lineTokens';
import { Position } from 'vs/editor/common/core/position';
import { IRange, Range } from 'vs/editor/common/core/range';
import { TokenizationResult2 } from 'vs/editor/common/core/token';
import { toUint32Array } from 'vs/editor/common/core/uint';
import { toUint32Array } from 'vs/base/common/uint';
import { EndOfLinePreference } from 'vs/editor/common/model';
import { TextModel } from 'vs/editor/common/model/textModel';
import * as modes from 'vs/editor/common/modes';

View File

@@ -210,7 +210,7 @@ suite('ViewModel', () => {
new Range(3, 2, 3, 2),
],
true,
'ine2'
['ine2', 'line3']
);
});