mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 18:46:36 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -346,38 +346,48 @@ export class RenderLineOutput {
|
||||
export function renderViewLine(input: RenderLineInput, sb: IStringBuilder): RenderLineOutput {
|
||||
if (input.lineContent.length === 0) {
|
||||
|
||||
let containsForeignElements = ForeignElementType.None;
|
||||
|
||||
let content: string = '<span><span></span></span>';
|
||||
|
||||
if (input.lineDecorations.length > 0) {
|
||||
// This line is empty, but it contains inline decorations
|
||||
const beforeClassNames: string[] = [];
|
||||
const afterClassNames: string[] = [];
|
||||
for (let i = 0, len = input.lineDecorations.length; i < len; i++) {
|
||||
const lineDecoration = input.lineDecorations[i];
|
||||
if (lineDecoration.type === InlineDecorationType.Before) {
|
||||
beforeClassNames.push(input.lineDecorations[i].className);
|
||||
containsForeignElements |= ForeignElementType.Before;
|
||||
}
|
||||
if (lineDecoration.type === InlineDecorationType.After) {
|
||||
afterClassNames.push(input.lineDecorations[i].className);
|
||||
containsForeignElements |= ForeignElementType.After;
|
||||
sb.appendASCIIString(`<span>`);
|
||||
|
||||
let beforeCount = 0;
|
||||
let afterCount = 0;
|
||||
let containsForeignElements = ForeignElementType.None;
|
||||
for (const lineDecoration of input.lineDecorations) {
|
||||
if (lineDecoration.type === InlineDecorationType.Before || lineDecoration.type === InlineDecorationType.After) {
|
||||
sb.appendASCIIString(`<span class="`);
|
||||
sb.appendASCIIString(lineDecoration.className);
|
||||
sb.appendASCIIString(`"></span>`);
|
||||
|
||||
if (lineDecoration.type === InlineDecorationType.Before) {
|
||||
containsForeignElements |= ForeignElementType.Before;
|
||||
beforeCount++;
|
||||
}
|
||||
if (lineDecoration.type === InlineDecorationType.After) {
|
||||
containsForeignElements |= ForeignElementType.After;
|
||||
afterCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (containsForeignElements !== ForeignElementType.None) {
|
||||
const beforeSpan = (beforeClassNames.length > 0 ? `<span class="${beforeClassNames.join(' ')}"></span>` : ``);
|
||||
const afterSpan = (afterClassNames.length > 0 ? `<span class="${afterClassNames.join(' ')}"></span>` : ``);
|
||||
content = `<span>${beforeSpan}${afterSpan}</span>`;
|
||||
}
|
||||
sb.appendASCIIString(`</span>`);
|
||||
|
||||
const characterMapping = new CharacterMapping(1, beforeCount + afterCount);
|
||||
characterMapping.setPartData(0, beforeCount, 0, 0);
|
||||
|
||||
return new RenderLineOutput(
|
||||
characterMapping,
|
||||
false,
|
||||
containsForeignElements
|
||||
);
|
||||
}
|
||||
|
||||
sb.appendASCIIString(content);
|
||||
// completely empty line
|
||||
sb.appendASCIIString('<span><span></span></span>');
|
||||
return new RenderLineOutput(
|
||||
new CharacterMapping(0, 0),
|
||||
false,
|
||||
containsForeignElements
|
||||
ForeignElementType.None
|
||||
);
|
||||
}
|
||||
|
||||
@@ -943,7 +953,12 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render
|
||||
break;
|
||||
|
||||
case CharCode.Null:
|
||||
sb.appendASCIIString('�');
|
||||
if (renderControlCharacters) {
|
||||
// See https://unicode-table.com/en/blocks/control-pictures/
|
||||
sb.write1(9216);
|
||||
} else {
|
||||
sb.appendASCIIString('�');
|
||||
}
|
||||
break;
|
||||
|
||||
case CharCode.UTF8_BOM:
|
||||
@@ -957,8 +972,12 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render
|
||||
if (strings.isFullWidthCharacter(charCode)) {
|
||||
charWidth++;
|
||||
}
|
||||
// See https://unicode-table.com/en/blocks/control-pictures/
|
||||
if (renderControlCharacters && charCode < 32) {
|
||||
sb.write1(9216 + charCode);
|
||||
} else if (renderControlCharacters && charCode === 127) {
|
||||
// DEL
|
||||
sb.write1(9249);
|
||||
} else {
|
||||
sb.write1(charCode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user