mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
tune collectionElementName() live template macro to work better in Jinja2 templates
This commit is contained in:
@@ -39,6 +39,12 @@ public class CollectionElementNameMacro extends Macro {
|
||||
if (lastDot >= 0) {
|
||||
param = param.substring(lastDot+1);
|
||||
}
|
||||
if (param.endsWith(")")) {
|
||||
int lastParen = param.lastIndexOf('(');
|
||||
if (lastParen > 0) {
|
||||
param = param.substring(0, lastParen);
|
||||
}
|
||||
}
|
||||
final String result = smartUnpluralize(param);
|
||||
return new TextResult(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user