in live_templates/src/main/java/org/intellij/sdk/liveTemplates/TitleCaseMacro.java [24:35]
protected Result calculateResult(Expression @NotNull [] params, ExpressionContext context, boolean quick) {
// Retrieve the text from the macro or selection, if any is available.
String text = getTextResult(params, context, true);
if (text == null) {
return null;
}
if (!text.isEmpty()) {
// Capitalize the start of every word
text = StringUtil.toTitleCase(text);
}
return new TextResult(text);
}