src/vs/editor/common/languages/supports/onEnter.ts/OnEnterSupport/onEnter
class OnEnterSupport:	public onEnter(autoIndent: EditorAutoIndentStrategy, previousLineText: string, beforeEnterText: string, afterEnterText: string): EnterAction | null {
		// (1): `regExpRules`
		if (autoIndent >= EditorAutoIndentStrategy.Advanced) {
			for (let i = 0, len = this._regExpRules.length; i < len; i++) {
				const rule = this._regExpRules[i];
				const regResult = [{
					reg: rule.beforeText,
					text: beforeEnterText
				}, {
					reg: rule.afterText,
					text: afterEnterText
				}, {
					reg: rule.previousLineText,
					text: previousLineText
				}].every((obj): boolean => {
					if (!obj.reg) {
						return true;
					}

					obj.reg.lastIndex = 0; // To disable the effect of the "g" flag.
					return obj.reg.test(obj.text);
				});

				if (regResult) {
					return rule.action;
				}
			}
		}

		// (2): Special indent-outdent
		if (autoIndent >= EditorAutoIndentStrategy.Brackets) {
			if (beforeEnterText.length > 0 && afterEnterText.length > 0) {
				for (let i = 0, len = this._brackets.length; i < len; i++) {
					const bracket = this._brackets[i];
					if (bracket.openRegExp.test(beforeEnterText) && bracket.closeRegExp.test(afterEnterText)) {
						return { indentAction: IndentAction.IndentOutdent };
					}
				}
			}
		}


		// (4): Open bracket based logic
		if (autoIndent >= EditorAutoIndentStrategy.Brackets) {
			if (beforeEnterText.length > 0) {
				for (let i = 0, len = this._brackets.length; i < len; i++) {
					const bracket = this._brackets[i];
					if (bracket.openRegExp.test(beforeEnterText)) {
						return { indentAction: IndentAction.Indent };
					}
				}
			}
		}

		return null;
	}