mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 03:58:33 -05:00
Merge from vscode 2b0b9136329c181a9e381463a1f7dc3a2d105a34 (#4880)
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { renderOcticons } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
import { escape } from 'vs/base/common/strings';
|
||||
@@ -54,10 +53,9 @@ export class HighlightedLabel {
|
||||
this.render();
|
||||
}
|
||||
|
||||
private render() {
|
||||
dom.clearNode(this.domNode);
|
||||
private render(): void {
|
||||
|
||||
let htmlContent: string[] = [];
|
||||
let htmlContent = '';
|
||||
let pos = 0;
|
||||
|
||||
for (const highlight of this.highlights) {
|
||||
@@ -65,27 +63,27 @@ export class HighlightedLabel {
|
||||
continue;
|
||||
}
|
||||
if (pos < highlight.start) {
|
||||
htmlContent.push('<span>');
|
||||
htmlContent += '<span>';
|
||||
const substring = this.text.substring(pos, highlight.start);
|
||||
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
|
||||
htmlContent.push('</span>');
|
||||
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
|
||||
htmlContent += '</span>';
|
||||
pos = highlight.end;
|
||||
}
|
||||
htmlContent.push('<span class="highlight">');
|
||||
htmlContent += '<span class="highlight">';
|
||||
const substring = this.text.substring(highlight.start, highlight.end);
|
||||
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
|
||||
htmlContent.push('</span>');
|
||||
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
|
||||
htmlContent += '</span>';
|
||||
pos = highlight.end;
|
||||
}
|
||||
|
||||
if (pos < this.text.length) {
|
||||
htmlContent.push('<span>');
|
||||
htmlContent += '<span>';
|
||||
const substring = this.text.substring(pos);
|
||||
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
|
||||
htmlContent.push('</span>');
|
||||
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
|
||||
htmlContent += '</span>';
|
||||
}
|
||||
|
||||
this.domNode.innerHTML = htmlContent.join('');
|
||||
this.domNode.innerHTML = htmlContent;
|
||||
this.domNode.title = this.title;
|
||||
this.didEverRender = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user