java regex does not support Ruby quoted named group syntax

This commit is contained in:
Bas Leijdekkers
2014-10-22 15:27:39 +02:00
parent 49dfd377d1
commit 6239e6086a
3 changed files with 8 additions and 2 deletions
@@ -29,6 +29,8 @@ public interface RegExpGroup extends RegExpAtom {
boolean isRubyNamedGroup();
boolean isNamedGroup();
@Nullable
String getGroupName();
}
@@ -56,6 +56,10 @@ public class RegExpGroupImpl extends RegExpElementImpl implements RegExpGroup {
getNode().findChildByType(RegExpTT.RUBY_QUOTED_NAMED_GROUP) != null;
}
public boolean isNamedGroup() {
return getNode().findChildByType(RegExpTT.RUBY_NAMED_GROUP) != null;
}
public String getGroupName() {
if (!isPythonNamedGroup()) {
return null;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ public class JavaRegExpHost implements RegExpLanguageHost {
@Override
public boolean supportsNamedGroupSyntax(RegExpGroup group) {
if (group.isRubyNamedGroup()) {
if (group.isNamedGroup()) {
final Module module = ModuleUtilCore.findModuleForPsiElement(group);
if (module != null) {
final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();