@@ -174,15 +174,40 @@ index 5b06636edb..60b508079a 100644
174
174
<!-- Require our AMD loader -->
175
175
<script src="./out/vs/loader.js"></script>
176
176
diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js
177
- index 65fae7c82d..9a9b8bbe3b 100644
177
+ index 65fae7c82d..a1974cd941 100644
178
178
--- a/src/vs/code/browser/workbench/workbench.js
179
179
+++ b/src/vs/code/browser/workbench/workbench.js
180
- @@ -7,21 +7,26 @@
180
+ @@ -7,21 +7,52 @@
181
181
182
182
(function () {
183
183
184
184
+ const basePath = window.location.pathname.replace(/\/+$/, '');
185
185
+ const base = window.location.origin + basePath;
186
+ +
187
+ + let nlsConfig;
188
+ + try {
189
+ + nlsConfig = JSON.parse(document.getElementById('vscode-remote-nls-configuration').getAttribute('data-settings'));
190
+ + if (nlsConfig._resolvedLanguagePackCoreLocation) {
191
+ + const bundles = Object.create(null);
192
+ + nlsConfig.loadBundle = (bundle, language, cb) => {
193
+ + let result = bundles[bundle];
194
+ + if (result) {
195
+ + return cb(undefined, result);
196
+ + }
197
+ + // FIXME: Only works if path separators are /.
198
+ + const path = nlsConfig._resolvedLanguagePackCoreLocation
199
+ + + '/' + bundle.replace(/\//g, '!') + '.nls.json';
200
+ + fetch(`${base}/resources/fetch?u=${JSON.stringify({ path })}`)
201
+ + .then((response) => response.json())
202
+ + .then((json) => {
203
+ + bundles[bundle] = json;
204
+ + cb(undefined, json);
205
+ + })
206
+ + .catch(cb);
207
+ + };
208
+ + }
209
+ + } catch (error) { /* Probably fine. */ }
210
+ +
186
211
require.config({
187
212
- baseUrl: `${window.location.origin}/out`,
188
213
+ baseUrl: `${base}/out`,
@@ -196,13 +221,15 @@ index 65fae7c82d..9a9b8bbe3b 100644
196
221
- 'xterm-addon-search': `${window.location.origin}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
197
222
- 'xterm-addon-web-links': `${window.location.origin}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
198
223
- 'semver-umd': `${window.location.origin}/node_modules/semver-umd/lib/semver-umd.js`,
224
+ - }
199
225
+ 'vscode-textmate': `${base}/node_modules/vscode-textmate/release/main`,
200
226
+ 'onigasm-umd': `${base}/node_modules/onigasm-umd/release/main`,
201
227
+ 'xterm': `${base}/node_modules/xterm/lib/xterm.js`,
202
228
+ 'xterm-addon-search': `${base}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
203
229
+ 'xterm-addon-web-links': `${base}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
204
230
+ 'semver-umd': `${base}/node_modules/semver-umd/lib/semver-umd.js`,
205
- }
231
+ + },
232
+ + 'vs/nls': nlsConfig
206
233
});
207
234
208
235
require(['vs/workbench/workbench.web.api'], function (api) {
0 commit comments