mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java regex does not support Ruby quoted named group syntax
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user