Merge branch 'master' into joh/continous-browser-tests
This commit is contained in:
commit
8a1ca2b6c0
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
|
@ -302,7 +302,7 @@
|
|||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Run Unit Tests",
|
||||
"program": "${workspaceFolder}/test/electron/index.js",
|
||||
"program": "${workspaceFolder}/test/unit/electron/index.js",
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Electron",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.exe"
|
||||
|
|
|
@ -17,7 +17,7 @@ if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
|
|||
|
||||
:: Run tests
|
||||
set ELECTRON_ENABLE_LOGGING=1
|
||||
%CODE% .\test\electron\index.js %*
|
||||
%CODE% .\test\unit\electron\index.js %*
|
||||
|
||||
popd
|
||||
|
||||
|
|
|
@ -29,10 +29,10 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
|||
cd $ROOT ; ulimit -n 4096 ; \
|
||||
ELECTRON_ENABLE_LOGGING=1 \
|
||||
"$CODE" \
|
||||
test/electron/index.js "$@"
|
||||
test/unit/electron/index.js "$@"
|
||||
else
|
||||
cd $ROOT ; \
|
||||
ELECTRON_ENABLE_LOGGING=1 \
|
||||
"$CODE" \
|
||||
test/electron/index.js --no-sandbox "$@" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox.
|
||||
test/unit/electron/index.js --no-sandbox "$@" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox.
|
||||
fi
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.monaco-editor .mtkz {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* TODO@tokenization bootstrap fix */
|
||||
/*.monaco-editor .view-line > span > span {
|
||||
float: none;
|
||||
|
|
|
@ -87,6 +87,7 @@ registerThemingParticipant((theme, collector) => {
|
|||
|
||||
const invisibles = theme.getColor(editorWhitespaces);
|
||||
if (invisibles) {
|
||||
collector.addRule(`.vs-whitespace { color: ${invisibles} !important; }`);
|
||||
collector.addRule(`.monaco-editor .mtkw { color: ${invisibles} !important; }`);
|
||||
collector.addRule(`.monaco-editor .mtkz { color: ${invisibles} !important; }`);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -549,7 +549,7 @@ function splitLargeTokens(lineContent: string, tokens: LinePart[], onlyAtSpaces:
|
|||
}
|
||||
|
||||
/**
|
||||
* Whitespace is rendered by "replacing" tokens with a special-purpose `vs-whitespace` type that is later recognized in the rendering phase.
|
||||
* Whitespace is rendered by "replacing" tokens with a special-purpose `mtkw` type that is later recognized in the rendering phase.
|
||||
* Moreover, a token is created for every visual indent because on some fonts the glyphs used for rendering whitespace (→ or ·) do not have the same width as .
|
||||
* The rendering phase will generate `style="width:..."` for these tokens.
|
||||
*/
|
||||
|
@ -616,7 +616,7 @@ function _applyRenderWhitespace(lineContent: string, len: number, continuesWithW
|
|||
// was in whitespace token
|
||||
if (!isInWhitespace || (!useMonospaceOptimizations && tmpIndent >= tabSize)) {
|
||||
// leaving whitespace token or entering a new indent
|
||||
result[resultLen++] = new LinePart(charIndex, 'vs-whitespace');
|
||||
result[resultLen++] = new LinePart(charIndex, 'mtkw');
|
||||
tmpIndent = tmpIndent % tabSize;
|
||||
}
|
||||
} else {
|
||||
|
@ -661,7 +661,7 @@ function _applyRenderWhitespace(lineContent: string, len: number, continuesWithW
|
|||
}
|
||||
}
|
||||
|
||||
result[resultLen++] = new LinePart(len, generateWhitespace ? 'vs-whitespace' : tokenType);
|
||||
result[resultLen++] = new LinePart(len, generateWhitespace ? 'mtkw' : tokenType);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -763,11 +763,12 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render
|
|||
const part = parts[partIndex];
|
||||
const partEndIndex = part.endIndex;
|
||||
const partType = part.type;
|
||||
const partRendersWhitespace = (renderWhitespace !== RenderWhitespace.None && (partType.indexOf('vs-whitespace') >= 0));
|
||||
const partRendersWhitespace = (renderWhitespace !== RenderWhitespace.None && (partType.indexOf('mtkw') >= 0));
|
||||
const partRendersWhitespaceWithWidth = partRendersWhitespace && !fontIsMonospace && (partType === 'mtkw'/*only whitespace*/ || !containsForeignElements);
|
||||
charOffsetInPart = 0;
|
||||
|
||||
sb.appendASCIIString('<span class="');
|
||||
sb.appendASCIIString(partType);
|
||||
sb.appendASCIIString(partRendersWhitespaceWithWidth ? 'mtkz' : partType);
|
||||
sb.appendASCII(CharCode.DoubleQuote);
|
||||
|
||||
if (partRendersWhitespace) {
|
||||
|
@ -787,13 +788,10 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render
|
|||
}
|
||||
}
|
||||
|
||||
if (!fontIsMonospace) {
|
||||
const partIsOnlyWhitespace = (partType === 'vs-whitespace');
|
||||
if (partIsOnlyWhitespace || !containsForeignElements) {
|
||||
sb.appendASCIIString(' style="display:inline-block;width:');
|
||||
sb.appendASCIIString(String(spaceWidth * partContentCnt));
|
||||
sb.appendASCIIString('px"');
|
||||
}
|
||||
if (partRendersWhitespaceWithWidth) {
|
||||
sb.appendASCIIString(' style="width:');
|
||||
sb.appendASCIIString(String(spaceWidth * partContentCnt));
|
||||
sb.appendASCIIString('px"');
|
||||
}
|
||||
sb.appendASCII(CharCode.GreaterThan);
|
||||
|
||||
|
|
|
@ -27,13 +27,13 @@ suite('Editor ViewLayout - ViewLineParts', () => {
|
|||
test('issue #3462: no whitespace shown at the end of a decorated line', () => {
|
||||
|
||||
let result = LineDecorationsNormalizer.normalize('abcabcabcabcabcabcabcabcabcabc', [
|
||||
new LineDecoration(15, 21, 'vs-whitespace', InlineDecorationType.Regular),
|
||||
new LineDecoration(15, 21, 'mtkw', InlineDecorationType.Regular),
|
||||
new LineDecoration(20, 21, 'inline-folded', InlineDecorationType.Regular),
|
||||
]);
|
||||
|
||||
assert.deepEqual(result, [
|
||||
new DecorationSegment(14, 18, 'vs-whitespace'),
|
||||
new DecorationSegment(19, 19, 'vs-whitespace inline-folded')
|
||||
new DecorationSegment(14, 18, 'mtkw'),
|
||||
new DecorationSegment(19, 19, 'mtkw inline-folded')
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
@ -195,8 +195,8 @@ suite('viewLineRenderer.renderLine', () => {
|
|||
createPart(48, 12),
|
||||
]);
|
||||
let expectedOutput = [
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtk2">export</span>',
|
||||
'<span class="mtk3">\u00a0</span>',
|
||||
'<span class="mtk4">class</span>',
|
||||
|
@ -207,8 +207,8 @@ suite('viewLineRenderer.renderLine', () => {
|
|||
'<span class="mtk9">\u00a0</span>',
|
||||
'<span class="mtk10">//\u00a0</span>',
|
||||
'<span class="mtk11">http://test.com</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:30px">\u00b7\u00b7\u00b7</span>'
|
||||
'<span class="mtkz" style="width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:30px">\u00b7\u00b7\u00b7</span>'
|
||||
].join('');
|
||||
let expectedOffsetsArr = [
|
||||
[0],
|
||||
|
@ -897,10 +897,10 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
null,
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtk2">He</span>',
|
||||
'<span class="mtk3">llo\u00a0world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -919,12 +919,12 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
null,
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtk2">He</span>',
|
||||
'<span class="mtk3">llo\u00a0world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -943,11 +943,11 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
null,
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtk2">He</span>',
|
||||
'<span class="mtk3">llo\u00a0world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -966,15 +966,15 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
null,
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u2192\u00a0</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u2192\u00a0</span>',
|
||||
'<span class="mtkz" style="width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtk2">He</span>',
|
||||
'<span class="mtk3">llo\u00a0world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:20px">\u00b7\uffeb</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u2192\u00a0</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\uffeb</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:20px">\u00b7\uffeb</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u2192\u00a0</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\uffeb</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -995,13 +995,13 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
[
|
||||
'<span>',
|
||||
'<span class="">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtk2">He</span>',
|
||||
'<span class="mtk3">llo\u00a0world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:20px">\u00b7\uffeb</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u2192\u00a0</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\uffeb</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:20px">\u00b7\uffeb</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u2192\u00a0</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\uffeb</span>',
|
||||
'<span class="mtkz" style="width:40px">\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -1022,10 +1022,10 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
[
|
||||
'<span>',
|
||||
'<span class="">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="vs-whitespace">\u00b7\u00b7</span>',
|
||||
'<span class="mtkw">\u00b7\u00b7</span>',
|
||||
'<span class="mtk2">He</span>',
|
||||
'<span class="mtk3">llo\u00a0world!</span>',
|
||||
'<span class="vs-whitespace">\u00b7\uffeb\u00b7\u00b7\u2192\u00a0\u00b7\u00b7\u00b7\uffeb\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'<span class="mtkw">\u00b7\uffeb\u00b7\u00b7\u2192\u00a0\u00b7\u00b7\u00b7\uffeb\u00b7\u00b7\u00b7\u00b7</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -1046,11 +1046,11 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
[
|
||||
'<span>',
|
||||
'<span class="mtk1">it</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtk1">it</span>',
|
||||
'<span class="mtk2">\u00a0</span>',
|
||||
'<span class="mtk3">it</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtkz" style="width:20px">\u00b7\u00b7</span>',
|
||||
'<span class="mtk3">it</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
|
@ -1071,12 +1071,12 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
null,
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk0">Hel</span>',
|
||||
'<span class="mtk1">lo</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk2">world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:30px">\u2192\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:30px">\u2192\u00a0\u00a0</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -1118,12 +1118,12 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
[new LineRange(0, 14)],
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk0">Hel</span>',
|
||||
'<span class="mtk1">lo</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk2">world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:30px">\u2192\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:30px">\u2192\u00a0\u00a0</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -1143,7 +1143,7 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
[new LineRange(0, 5)],
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk0">Hel</span>',
|
||||
'<span class="mtk1">lo</span>',
|
||||
'<span class="mtk2">\u00a0world!\u00a0\u00a0\u00a0</span>',
|
||||
|
@ -1167,11 +1167,11 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
[new LineRange(0, 5), new LineRange(9, 14)],
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk0">Hel</span>',
|
||||
'<span class="mtk1">lo</span>',
|
||||
'<span class="mtk2">\u00a0world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:30px">\u2192\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:30px">\u2192\u00a0\u00a0</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -1192,11 +1192,11 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
[new LineRange(9, 14), new LineRange(0, 5)],
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk0">Hel</span>',
|
||||
'<span class="mtk1">lo</span>',
|
||||
'<span class="mtk2">\u00a0world!</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:30px">\u2192\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:30px">\u2192\u00a0\u00a0</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
);
|
||||
|
@ -1214,9 +1214,9 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
[new LineRange(0, 1), new LineRange(1, 2), new LineRange(2, 3)],
|
||||
[
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk0">*</span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:10px">\u00b7</span>',
|
||||
'<span class="mtkz" style="width:10px">\u00b7</span>',
|
||||
'<span class="mtk0">S</span>',
|
||||
'</span>',
|
||||
].join('')
|
||||
|
@ -1294,7 +1294,7 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
|
||||
let expected = [
|
||||
'<span>',
|
||||
'<span class="vs-whitespace before">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtkw before">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtk3">bla</span>',
|
||||
'</span>'
|
||||
].join('');
|
||||
|
@ -1329,7 +1329,7 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
|
||||
let expected = [
|
||||
'<span>',
|
||||
'<span class="vs-whitespace" style="display:inline-block;width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtkz" style="width:40px">\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtk3 before">b</span>',
|
||||
'<span class="mtk3">la</span>',
|
||||
'</span>'
|
||||
|
@ -1535,11 +1535,11 @@ suite('viewLineRenderer.renderLine 2', () => {
|
|||
let expected = [
|
||||
'<span>',
|
||||
'<span class="mtk3">asd</span>',
|
||||
'<span class="vs-whitespace">\u00b7</span>',
|
||||
'<span class="mtkw">\u00b7</span>',
|
||||
'<span class="mtk3">=</span>',
|
||||
'<span class="vs-whitespace">\u00b7</span>',
|
||||
'<span class="mtkw">\u00b7</span>',
|
||||
'<span class="mtk3">"擦"</span>',
|
||||
'<span class="vs-whitespace">\u2192\u00a0\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtkw">\u2192\u00a0\u2192\u00a0\u00a0\u00a0</span>',
|
||||
'<span class="mtk3">#asd</span>',
|
||||
'</span>'
|
||||
].join('');
|
||||
|
|
2
src/vs/vscode.proposed.d.ts
vendored
2
src/vs/vscode.proposed.d.ts
vendored
|
@ -1625,7 +1625,7 @@ declare module 'vscode' {
|
|||
//#endregion
|
||||
|
||||
|
||||
//#region
|
||||
//#region https://github.com/microsoft/vscode/issues/90208
|
||||
|
||||
export interface ExtensionContext {
|
||||
/**
|
||||
|
|
|
@ -57,7 +57,7 @@ const withReporter = (function () {
|
|||
})()
|
||||
|
||||
const outdir = argv.build ? 'out-build' : 'out';
|
||||
const out = path.join(__dirname, `../../${outdir}`);
|
||||
const out = path.join(__dirname, `../../../${outdir}`);
|
||||
|
||||
const testModules = (async function () {
|
||||
|
||||
|
@ -95,10 +95,9 @@ const testModules = (async function () {
|
|||
async function runTestsInBrowser(testModules, browserType) {
|
||||
|
||||
const browser = await playwright[browserType].launch({ headless: !Boolean(argv.debug) });
|
||||
const context = await browser.newContext();
|
||||
|
||||
const page = (await browser.defaultContext().pages())[0]
|
||||
const target = url.pathToFileURL(path.join(__dirname, 'renderer.html'));
|
||||
const page = await context.newPage(target.href);
|
||||
await page.goto(target.href);
|
||||
|
||||
const emitter = new events.EventEmitter();
|
||||
await page.exposeFunction('mocha_report', (type, data1, data2) => {
|
|
@ -3,12 +3,12 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>VSCode Tests</title>
|
||||
<link href="../../node_modules/mocha/mocha.css" rel="stylesheet" />
|
||||
<link href="../../../node_modules/mocha/mocha.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="mocha"></div>
|
||||
<script src="../../node_modules/mocha/mocha.js"></script>
|
||||
<script src="../../../node_modules/mocha/mocha.js"></script>
|
||||
<script>
|
||||
// !!! DO NOT CHANGE !!!
|
||||
// Our unit tests may run in environments without
|
||||
|
@ -37,17 +37,17 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<script src="../../out/vs/loader.js"></script>
|
||||
<script src="../../../out/vs/loader.js"></script>
|
||||
<script>
|
||||
// configure loader
|
||||
const baseUrl = window.location.href;
|
||||
require.config({
|
||||
catchError: true,
|
||||
baseUrl: new URL('../../src', baseUrl).href,
|
||||
baseUrl: new URL('../../../src', baseUrl).href,
|
||||
paths: {
|
||||
'vs': new URL('../../out/vs', baseUrl).href,
|
||||
assert: new URL('../assert.js', baseUrl).href,
|
||||
sinon: new URL('../../node_modules/sinon/pkg/sinon-1.17.7.js', baseUrl).href
|
||||
'vs': new URL('../../../out/vs', baseUrl).href,
|
||||
assert: new URL('../../assert.js', baseUrl).href,
|
||||
sinon: new URL('../../../node_modules/sinon/pkg/sinon-1.17.7.js', baseUrl).href
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -102,7 +102,7 @@
|
|||
runner.on('pending', test => window.mocha_report('pending', serializeRunnable(test)));
|
||||
};
|
||||
|
||||
window.loadAndRun = async function loadAndRun (modules, manual = false) {
|
||||
window.loadAndRun = async function loadAndRun(modules, manual = false) {
|
||||
// load
|
||||
// await Promise.all(modules.map(module => new Promise((resolve, reject) =>{
|
||||
// require([module], resolve, err => {
|
||||
|
@ -120,7 +120,7 @@
|
|||
|
||||
// run
|
||||
return new Promise((resolve, reject) => {
|
||||
if(!manual) {
|
||||
if (!manual) {
|
||||
mocha.reporter(PlaywrightReporter);
|
||||
}
|
||||
mocha.run(failCount => resolve(failCount === 0));
|
||||
|
@ -129,7 +129,7 @@
|
|||
|
||||
|
||||
const modules = new URL(window.location.href).searchParams.getAll('m');
|
||||
if(Array.isArray(modules) && modules.length > 0){
|
||||
if (Array.isArray(modules) && modules.length > 0) {
|
||||
console.log('MANUALLY running tests', modules);
|
||||
|
||||
loadAndRun(modules, true).then(() => console.log('done'), err => console.log(err));
|
|
@ -3,12 +3,12 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>VSCode Tests</title>
|
||||
<link href="../../node_modules/mocha/mocha.css" rel="stylesheet" />
|
||||
<link href="../../../node_modules/mocha/mocha.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="mocha"></div>
|
||||
<script src="../../node_modules/mocha/mocha.js"></script>
|
||||
<script src="../../../node_modules/mocha/mocha.js"></script>
|
||||
|
||||
<script>
|
||||
|
|
@ -10,8 +10,8 @@ const assert = require('assert');
|
|||
const path = require('path');
|
||||
const glob = require('glob');
|
||||
const util = require('util');
|
||||
const bootstrap = require('../../src/bootstrap');
|
||||
const coverage = require('../coverage');
|
||||
const bootstrap = require('../../../src/bootstrap');
|
||||
const coverage = require('../../coverage');
|
||||
|
||||
// Disabled custom inspect. See #38847
|
||||
if (util.inspect && util.inspect['defaultOptions']) {
|
||||
|
@ -24,7 +24,7 @@ let _out;
|
|||
|
||||
function initLoader(opts) {
|
||||
let outdir = opts.build ? 'out-build' : 'out';
|
||||
_out = path.join(__dirname, `../../${outdir}`);
|
||||
_out = path.join(__dirname, `../../../${outdir}`);
|
||||
|
||||
// setup loader
|
||||
loader = require(`${_out}/vs/loader`);
|
||||
|
@ -32,7 +32,7 @@ function initLoader(opts) {
|
|||
nodeRequire: require,
|
||||
nodeMain: __filename,
|
||||
catchError: true,
|
||||
baseUrl: bootstrap.uriFromPath(path.join(__dirname, '../../src')),
|
||||
baseUrl: bootstrap.uriFromPath(path.join(__dirname, '../../../src')),
|
||||
paths: {
|
||||
'vs': `../${outdir}/vs`,
|
||||
'lib': `../${outdir}/lib`,
|
Loading…
Reference in a new issue