Merge branch 'master' of git.labs.intellij.net:idea/community

This commit is contained in:
Dmitry Jemerov
2010-11-12 17:35:31 +03:00
5 changed files with 20 additions and 4 deletions
@@ -242,8 +242,11 @@ public class PsiElementFactoryImpl extends PsiJavaParserFacadeImpl implements Ps
throw new IncorrectOperationException("Cannot create field with type \"<null_type>\".");
}
final FileElement treeHolder = DummyHolderFactory.createHolder(myManager, null).getTreeElement();
final CompositeElement treeElement =
getJavaParsingContext(treeHolder).getDeclarationParsing().parseParameterText(type.getCanonicalText() + " " + name);
final String text = type.getCanonicalText() + " " + name;
final CompositeElement treeElement = getJavaParsingContext(treeHolder).getDeclarationParsing().parseParameterText(text);
if (treeElement == null) {
throw new AssertionError("Null element for text = " + text);
}
treeHolder.rawAddChildren(treeElement);
CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(myManager.getProject());
@@ -18,6 +18,9 @@ public class PsiSearchRequest {
boolean caseSensitive,
@NotNull RequestResultProcessor processor) {
if (word.length() == 0) {
throw new IllegalArgumentException("Cannot search for elements with empty text");
}
this.searchScope = searchScope;
this.word = word;
this.searchContext = searchContext;
@@ -8,9 +8,8 @@ import org.jetbrains.plugins.groovy.dsl.psi.PsiEnhancerCategory
import org.jetbrains.plugins.groovy.dsl.toplevel.CompositeContextFilter
import org.jetbrains.plugins.groovy.dsl.toplevel.ContextFilter
import org.jetbrains.plugins.groovy.dsl.toplevel.GdslMetaClassProperties
import com.intellij.openapi.project.Project
/**
/**
* @author ilyas
*/
@@ -20,6 +19,7 @@ public class GroovyDslExecutor {
private final String myFileName;
static final String ideaVersion
private boolean locked = false
static {
def major = ApplicationInfo.instance.majorVersion
@@ -52,9 +52,12 @@ public class GroovyDslExecutor {
mc.initialize()
script.metaClass = mc
script.run()
locked = true
}
def addClassEnhancer(List<ContextFilter> cts, Closure toDo) {
assert !locked : 'Contributing to GDSL is only allowed at the top-level of the *.gdsl script'
enhancers << Pair.create(CompositeContextFilter.compose(cts, false), toDo)
}
@@ -115,6 +115,9 @@ public abstract class AbstractDomChildrenDescriptor implements XmlElementDescrip
@Nullable
public PsiElement getDeclaration() {
final PomTarget target = ((CustomDomChildrenDescription)description).getTagNameDescriptor().findDeclaration(finalDomElement);
if (target == description) {
return childTag;
}
return target == null ? null : PomService.convertToPsi(childTag.getProject(), target);
}
@@ -38,6 +38,10 @@ public class BooleanValueConverter extends ResolvingConverter<String> {
return new BooleanValueConverter(allowEmpty);
}
public BooleanValueConverter() {
this(false);
}
public BooleanValueConverter(final boolean allowEmpty) {
myAllowEmpty = allowEmpty;
}