Skip to content

Commit 8bc37bc

Browse files
committed
Do not ship octicons in standalone editor
1 parent 30ce966 commit 8bc37bc

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

build/gulpfile.editor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ function editorLoaderConfig(removeAllOSS) {
5858

5959
// never ship marked in editor
6060
result.paths['vs/base/common/marked/marked'] = 'out-build/vs/base/common/marked/marked.mock';
61+
// never ship octicons in editor
62+
result.paths['vs/base/browser/ui/octiconLabel/octiconLabel'] = 'out-build/vs/base/browser/ui/octiconLabel/octiconLabel.mock';
6163

6264
if (removeAllOSS) {
6365
result.paths['vs/languages/lib/common/beautify-html'] = 'out-build/vs/languages/lib/common/beautify-html.mock';
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
import octiconLabel = require('vs/base/browser/ui/octiconLabel/octiconLabel');
6+
import {escape} from 'vs/base/common/strings';
7+
8+
function expand(text:string): string {
9+
return text;
10+
}
11+
12+
class MockOcticonLabel {
13+
14+
private _container: HTMLElement;
15+
16+
constructor(container: HTMLElement) {
17+
this._container = container;
18+
}
19+
20+
set text(text: string) {
21+
let innerHTML = text || '';
22+
innerHTML = escape(innerHTML);
23+
innerHTML = expand(innerHTML);
24+
this._container.innerHTML = innerHTML;
25+
}
26+
27+
}
28+
29+
var mock: typeof octiconLabel = {
30+
expand: expand,
31+
OcticonLabel: <any>MockOcticonLabel
32+
};
33+
export = mock;

0 commit comments

Comments
 (0)