src/vs/editor/standalone/common/monarch/monarchLexer.ts/MonarchTokenizer/_locateMode
class MonarchTokenizer:	private _locateMode(mimetypeOrModeId: string): string | null {
		if (!mimetypeOrModeId || !this._modeService.isRegisteredMode(mimetypeOrModeId)) {
			return null;
		}

		if (mimetypeOrModeId === this._modeId) {
			// embedding myself...
			return mimetypeOrModeId;
		}

		let modeId = this._modeService.getModeId(mimetypeOrModeId);

		if (modeId) {
			// Fire mode loading event
			this._modeService.triggerMode(modeId);
			this._embeddedModes[modeId] = true;
		}

		return modeId;
	}