src/vs/workbench/services/textMate/browser/nativeTextMateService.ts/TextMateService/_onDidCreateGrammarFactory
class TextMateService:	protected override _onDidCreateGrammarFactory(grammarDefinitions: IValidGrammarDefinition[]): void {
		this._killWorker();

		if (RUN_TEXTMATE_IN_WORKER) {
			const workerHost = new TextMateWorkerHost(this, this._extensionResourceLoaderService);
			const createData: ICreateData = { grammarDefinitions };
			const worker = createWebWorker<TextMateWorker>(this._modelService, this._languageConfigurationService, {
				createData,
				label: 'textMateWorker',
				moduleId: 'vs/workbench/services/textMate/browser/textMateWorker',
				host: workerHost
			});

			this._worker = worker;
			worker.getProxy().then((proxy) => {
				if (this._worker !== worker) {
					// disposed in the meantime
					return;
				}
				this._workerProxy = proxy;
				if (this._currentTheme && this._currentTokenColorMap) {
					this._workerProxy.acceptTheme(this._currentTheme, this._currentTokenColorMap);
				}
				this._modelService.getModels().forEach((model) => this._onModelAdded(model));
			});
		}
	}