void (@Nullable XExpression text) { if (text == null) { text = getMode() == EvaluationMode.EXPRESSION ? XExpressionImpl.EMPTY_EXPRESSION : XExpressionImpl.EMPTY_CODE_FRAGMENT; } Language language = text.getLanguage(); if (language == null) { if (myContext != null) { language = myContext.getLanguage(); } if (language == null && mySourcePosition != null) { language = LanguageUtil.getFileLanguage(mySourcePosition.getFile()); } if (language == null) { language = LanguageUtil.getFileTypeLanguage(getEditorsProvider().getFileType()); } text = new XExpressionImpl(text.getExpression(), language, text.getCustomInfo(), text.getMode()); } myLanguageChooser.requestUpdate(language); doSetText(text); }