diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 04c168cb1a6..25b41bd3a91 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -211,7 +211,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op const deps = gulp.src(dependenciesSrc, { base: '.', dot: true }) .pipe(filter(['**', '!**/package-lock.json'])) .pipe(util.cleanNodeModules(path.join(__dirname, '.nativeignore'))) - .pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar')); + .pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*', '**/*.wasm'], 'app/node_modules.asar')); let all = es.merge( packageJsonStream, diff --git a/src/vs/workbench/services/textMate/electron-browser/textMateService.ts b/src/vs/workbench/services/textMate/electron-browser/textMateService.ts index 3d0e53bf45e..22ecdbdcc5f 100644 --- a/src/vs/workbench/services/textMate/electron-browser/textMateService.ts +++ b/src/vs/workbench/services/textMate/electron-browser/textMateService.ts @@ -24,6 +24,7 @@ import { TMGrammarFactory } from 'vs/workbench/services/textMate/common/TMGramma import { IModelContentChangedEvent } from 'vs/editor/common/model/textModelEvents'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { IExtensionResourceLoaderService } from 'vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; const RUN_TEXTMATE_IN_WORKER = false; @@ -117,7 +118,7 @@ export class TextMateWorkerHost { constructor( private readonly textMateService: TextMateService, - @IExtensionResourceLoaderService private readonly _extensionResourceLoaderService: IExtensionResourceLoaderService, + @IExtensionResourceLoaderService private readonly _extensionResourceLoaderService: IExtensionResourceLoaderService ) { } @@ -147,6 +148,7 @@ export class TextMateService extends AbstractTextMateService { @IConfigurationService configurationService: IConfigurationService, @IStorageService storageService: IStorageService, @IModelService private readonly _modelService: IModelService, + @IWorkbenchEnvironmentService private readonly _environmentService: IWorkbenchEnvironmentService ) { super(modeService, themeService, extensionResourceLoaderService, notificationService, logService, configurationService, storageService); this._worker = null; @@ -178,7 +180,11 @@ export class TextMateService extends AbstractTextMateService { } protected async _loadVSCodeOnigurumWASM(): Promise { - const wasmPath = require.toUrl('../../../../../../node_modules/vscode-oniguruma-wasm/release/onig.wasm'); + const wasmPath = ( + this._environmentService.isBuilt + ? require.toUrl('../../../../../../node_modules.asar.unpacked/vscode-oniguruma-wasm/release/onig.wasm') + : require.toUrl('../../../../../../node_modules/vscode-oniguruma-wasm/release/onig.wasm') + ); const response = await fetch(wasmPath); return response; }