Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -2,12 +2,12 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IDisposable } from 'vs/base/common/lifecycle';
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';
export interface IHighlight {
start: number;
@@ -22,7 +22,7 @@ export class HighlightedLabel implements IDisposable {
private highlights: IHighlight[];
private didEverRender: boolean;
constructor(container: HTMLElement) {
constructor(container: HTMLElement, private supportOcticons: boolean) {
this.domNode = document.createElement('span');
this.domNode.className = 'monaco-highlighted-label';
this.didEverRender = false;
@@ -69,19 +69,22 @@ export class HighlightedLabel implements IDisposable {
}
if (pos < highlight.start) {
htmlContent.push('<span>');
htmlContent.push(renderOcticons(this.text.substring(pos, highlight.start)));
const substring = this.text.substring(pos, highlight.start);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
pos = highlight.end;
}
htmlContent.push('<span class="highlight">');
htmlContent.push(renderOcticons(this.text.substring(highlight.start, highlight.end)));
const substring = this.text.substring(highlight.start, highlight.end);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
pos = highlight.end;
}
if (pos < this.text.length) {
htmlContent.push('<span>');
htmlContent.push(renderOcticons(this.text.substring(pos)));
const substring = this.text.substring(pos);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
}
@@ -91,8 +94,8 @@ export class HighlightedLabel implements IDisposable {
}
dispose() {
this.text = null;
this.highlights = null;
this.text = null!; // StrictNullOverride: nulling out ok in dispose
this.highlights = null!; // StrictNullOverride: nulling out ok in dispose
}
static escapeNewLines(text: string, highlights: IHighlight[]): string {