mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
make grammar GrammarElementTitleSwitch more robust
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@typefox.io>
This commit is contained in:
parent
dc674d1abf
commit
9b43417e24
1 changed files with 2 additions and 0 deletions
|
@ -104,6 +104,8 @@ public class GrammarElementTitleSwitch extends XtextSwitch<String> implements Fu
|
|||
if (!showQualified && !showRule)
|
||||
return result;
|
||||
AbstractRule rule = GrammarUtil.containingRule(ele);
|
||||
if (rule == null)
|
||||
return "<AbstractElement not contained in AbstractRule!>:" + result;
|
||||
if (!showQualified)
|
||||
return result + ":" + rule.getName();
|
||||
GrammarElementTitleSwitch others = copy();
|
||||
|
|
Loading…
Reference in a new issue