Skip to content

Commit 545af1f

Browse files
committed
Remove vs/text loader plugin
1 parent 742f017 commit 545af1f

18 files changed

Lines changed: 154 additions & 217 deletions

build/gulpfile.common.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,8 @@ exports.loaderConfig = function (emptyPaths) {
3333
var result = {
3434
paths: {
3535
'vs': 'out-build/vs',
36-
'vs/extensions': 'extensions',
3736
'vscode': 'empty:'
3837
},
39-
'vs/text': {
40-
paths: {
41-
'vs/extensions': 'extensions'
42-
}
43-
},
4438
nodeModules: emptyPaths||[]
4539
};
4640

@@ -55,7 +49,6 @@ function loader(bundledFileHeader) {
5549
'out-build/vs/loader.js',
5650
'out-build/vs/css.js',
5751
'out-build/vs/nls.js',
58-
'out-build/vs/text.js'
5952
], { base: 'out-build' })
6053
.pipe(es.through(function(data) {
6154
if (isFirst) {

build/gulpfile.editor.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ var editorResources = [
3434

3535
var editorOtherSources = [
3636
'out-build/vs/css.js',
37-
'out-build/vs/nls.js',
38-
'out-build/vs/text.js'
37+
'out-build/vs/nls.js'
3938
];
4039

4140
var BUNDLED_FILE_HEADER = [

build/gulpfile.hygiene.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ var indentationFilter = [
4848
'!**/vs/base/common/marked/raw.marked.js',
4949
'!**/vs/base/common/winjs.base.raw.js',
5050
'!**/vs/base/node/terminateProcess.sh',
51-
'!**/vs/text.js',
5251
'!**/vs/nls.js',
5352
'!**/vs/css.js',
5453
'!**/vs/loader.js',

src/buildfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ exports.standaloneLanguages = require('./vs/editor/standalone-languages/buildfil
1212
exports.standaloneLanguages2 = require('./vs/languages/buildfile-editor-languages').collectModules();
1313

1414
exports.entrypoint = function (name) {
15-
return [{ name: name, include: [], exclude: ['vs/css', 'vs/nls', 'vs/text'] }];
15+
return [{ name: name, include: [], exclude: ['vs/css', 'vs/nls'] }];
1616
};

src/vs/base/buildfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
exports.collectModules = function() {
99
return [{
1010
name: 'vs/base/common/worker/workerServer',
11-
exclude: [ 'vs/css', 'vs/nls', 'vs/text' ]
11+
exclude: [ 'vs/css', 'vs/nls' ]
1212
}, {
1313
name: 'vs/base/common/worker/simpleWorker',
14-
exclude: [ 'vs/css', 'vs/nls', 'vs/text' ]
14+
exclude: [ 'vs/css', 'vs/nls' ]
1515
}];
1616
};

src/vs/code/buildfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
function createModuleDescription(name, exclude) {
88
var result= {};
9-
var excludes = ['vs/css', 'vs/nls', 'vs/text'];
9+
var excludes = ['vs/css', 'vs/nls'];
1010
result.name= name;
1111
if (Array.isArray(exclude) && exclude.length > 0) {
1212
excludes = excludes.concat(exclude);

src/vs/editor/buildfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ exports.collectModules = function() {
99
return [{
1010
name: 'vs/editor/common/worker/editorWorkerServer',
1111
include: [ 'vs/base/common/severity' ],
12-
exclude: [ 'vs/base/common/worker/workerServer', 'vs/css', 'vs/nls', 'vs/text' ]
12+
exclude: [ 'vs/base/common/worker/workerServer', 'vs/css', 'vs/nls' ]
1313
}, {
1414
name: 'vs/editor/common/services/editorSimpleWorker',
15-
exclude: [ 'vs/base/common/worker/simpleWorker', 'vs/css', 'vs/nls', 'vs/text' ]
15+
exclude: [ 'vs/base/common/worker/simpleWorker', 'vs/css', 'vs/nls' ]
1616
}];
1717
};

src/vs/languages/buildfile-editor-languages.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var EntryPoint = (function() {
2323
excludes = toArray(excludes);
2424
this.result.push({
2525
name: moduleId,
26-
exclude: ['vs/css', 'vs/nls', 'vs/text'].concat(this.modules).concat(excludes)
26+
exclude: ['vs/css', 'vs/nls'].concat(this.modules).concat(excludes)
2727
});
2828
return new EntryPoint(this.result, this.modules.concat([moduleId].concat(excludes)));
2929
};
@@ -48,17 +48,17 @@ exports.collectModules = function(args) {
4848

4949
result.push({
5050
name: 'vs/languages/typescript/common/lib/typescriptServices',
51-
exclude: ['vs/css', 'vs/nls', 'vs/text']
51+
exclude: ['vs/css', 'vs/nls']
5252
});
5353

5454
result.push({
5555
name: 'vs/languages/typescript/common/worker',
56-
exclude: ['vs/base/common/worker/simpleWorker', 'vs/languages/typescript/common/lib/typescriptServices', 'vs/css', 'vs/nls', 'vs/text']
56+
exclude: ['vs/base/common/worker/simpleWorker', 'vs/languages/typescript/common/lib/typescriptServices', 'vs/css', 'vs/nls']
5757
});
5858

5959
result.push({
6060
name: 'vs/languages/typescript/common/mode',
61-
exclude: ['vs/editor/editor.main', 'vs/languages/typescript/common/lib/typescriptServices', 'vs/css', 'vs/nls', 'vs/text']
61+
exclude: ['vs/editor/editor.main', 'vs/languages/typescript/common/lib/typescriptServices', 'vs/css', 'vs/nls']
6262
});
6363

6464
return result;

src/vs/languages/buildfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var EntryPoint = (function() {
2323
excludes = toArray(excludes);
2424
this.result.push({
2525
name: moduleId,
26-
exclude: ['vs/css', 'vs/nls', 'vs/text'].concat(this.modules).concat(excludes)
26+
exclude: ['vs/css', 'vs/nls'].concat(this.modules).concat(excludes)
2727
});
2828
return new EntryPoint(this.result, this.modules.concat([moduleId].concat(excludes)));
2929
};
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
var fs = require('fs');
2+
var path = require('path');
3+
4+
toString(path.join(__dirname, 'lib.d.ts'), path.join(__dirname, 'lib-ts.js'));
5+
toString(path.join(__dirname, 'lib.es6.d.ts'), path.join(__dirname, 'lib-es6-ts.js'));
6+
7+
function toString(source, dest) {
8+
9+
var contents = fs.readFileSync(source).toString();
10+
11+
fs.writeFileSync(dest,
12+
`/*---------------------------------------------------------------------------------------------
13+
* Copyright (c) Microsoft Corporation. All rights reserved.
14+
* Licensed under the MIT License. See License.txt in the project root for license information.
15+
*--------------------------------------------------------------------------------------------*/
16+
17+
// This is a generated file from ${path.basename(source)}
18+
19+
define([], { contents: "${escapeText(contents)}"});
20+
21+
`)
22+
}
23+
24+
/**
25+
* Escape text such that it can be used in a javascript string enclosed by double quotes (")
26+
*/
27+
function escapeText(text) {
28+
// http://www.javascriptkit.com/jsref/escapesequence.shtml
29+
// \b Backspace.
30+
// \f Form feed.
31+
// \n Newline.
32+
// \O Nul character.
33+
// \r Carriage return.
34+
// \t Horizontal tab.
35+
// \v Vertical tab.
36+
// \' Single quote or apostrophe.
37+
// \" Double quote.
38+
// \\ Backslash.
39+
// \ddd The Latin-1 character specified by the three octal digits between 0 and 377. ie, copyright symbol is \251.
40+
// \xdd The Latin-1 character specified by the two hexadecimal digits dd between 00 and FF. ie, copyright symbol is \xA9.
41+
// \udddd The Unicode character specified by the four hexadecimal digits dddd. ie, copyright symbol is \u00A9.
42+
var _backspace = '\b'.charCodeAt(0);
43+
var _formFeed = '\f'.charCodeAt(0);
44+
var _newLine = '\n'.charCodeAt(0);
45+
var _nullChar = 0;
46+
var _carriageReturn = '\r'.charCodeAt(0);
47+
var _tab = '\t'.charCodeAt(0);
48+
var _verticalTab = '\v'.charCodeAt(0);
49+
var _backslash = '\\'.charCodeAt(0);
50+
var _doubleQuote = '"'.charCodeAt(0);
51+
52+
var startPos = 0, chrCode, replaceWith = null, resultPieces = [];
53+
54+
for (var i = 0, len = text.length; i < len; i++) {
55+
chrCode = text.charCodeAt(i);
56+
switch (chrCode) {
57+
case _backspace:
58+
replaceWith = '\\b';
59+
break;
60+
case _formFeed:
61+
replaceWith = '\\f';
62+
break;
63+
case _newLine:
64+
replaceWith = '\\n';
65+
break;
66+
case _nullChar:
67+
replaceWith = '\\0';
68+
break;
69+
case _carriageReturn:
70+
replaceWith = '\\r';
71+
break;
72+
case _tab:
73+
replaceWith = '\\t';
74+
break;
75+
case _verticalTab:
76+
replaceWith = '\\v';
77+
break;
78+
case _backslash:
79+
replaceWith = '\\\\';
80+
break;
81+
case _doubleQuote:
82+
replaceWith = '\\"';
83+
break;
84+
}
85+
if (replaceWith !== null) {
86+
resultPieces.push(text.substring(startPos, i));
87+
resultPieces.push(replaceWith);
88+
startPos = i + 1;
89+
replaceWith = null;
90+
}
91+
}
92+
resultPieces.push(text.substring(startPos, len));
93+
return resultPieces.join('');
94+
}

0 commit comments

Comments
 (0)