Search in sources :

Example 1 with RuleDefinition

use of com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition in project intellij by bazelbuild.

the class LoadedSkylarkExtensionTest method setBuiltInRuleNames.

private void setBuiltInRuleNames(String... ruleNames) {
    ImmutableMap.Builder<String, RuleDefinition> rules = ImmutableMap.builder();
    for (String name : ruleNames) {
        rules.put(name, new RuleDefinition(name, ImmutableMap.of(), null));
    }
    MockBuildLanguageSpecProvider specProvider = new MockBuildLanguageSpecProvider();
    specProvider.setRules(rules.build());
    registerApplicationService(BuildLanguageSpecProvider.class, specProvider);
    specProvider.setRules(rules.build());
}
Also used : RuleDefinition(com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition) ImmutableMap(com.google.common.collect.ImmutableMap)

Example 2 with RuleDefinition

use of com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition in project intellij by bazelbuild.

the class BuiltInRuleAnnotatorTest method setRules.

private void setRules(String... ruleNames) {
    ImmutableMap.Builder<String, RuleDefinition> rules = ImmutableMap.builder();
    for (String name : ruleNames) {
        rules.put(name, new RuleDefinition(name, ImmutableMap.of(), null));
    }
    specProvider.setRules(rules.build());
}
Also used : RuleDefinition(com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition) ImmutableMap(com.google.common.collect.ImmutableMap)

Example 3 with RuleDefinition

use of com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition in project intellij by bazelbuild.

the class BuiltInFunctionCompletionContributorTest method setRules.

private void setRules(String... ruleNames) {
    ImmutableMap.Builder<String, RuleDefinition> rules = ImmutableMap.builder();
    for (String name : ruleNames) {
        rules.put(name, new RuleDefinition(name, ImmutableMap.of(), null));
    }
    specProvider.setRules(rules.build());
}
Also used : RuleDefinition(com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition) ImmutableMap(com.google.common.collect.ImmutableMap)

Example 4 with RuleDefinition

use of com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition in project intellij by bazelbuild.

the class RuleTargetCompletionTest method setBuildLanguageSpecRules.

private static void setBuildLanguageSpecRules(MockBuildLanguageSpecProvider specProvider, String... ruleNames) {
    ImmutableMap.Builder<String, RuleDefinition> rules = ImmutableMap.builder();
    for (String name : ruleNames) {
        rules.put(name, new RuleDefinition(name, ImmutableMap.of(), null));
    }
    specProvider.setRules(rules.build());
}
Also used : RuleDefinition(com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition) ImmutableMap(com.google.common.collect.ImmutableMap)

Example 5 with RuleDefinition

use of com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition in project intellij by bazelbuild.

the class BuiltInFunctionAttributeCompletionContributorTest method setRuleAndAttributes.

private void setRuleAndAttributes(String ruleName, String... attributes) {
    ImmutableMap.Builder<String, AttributeDefinition> map = ImmutableMap.builder();
    for (String attr : attributes) {
        map.put(attr, new AttributeDefinition(attr, Build.Attribute.Discriminator.UNKNOWN, false, null, null));
    }
    RuleDefinition rule = new RuleDefinition(ruleName, map.build(), null);
    specProvider.setRules(ImmutableMap.of(ruleName, rule));
}
Also used : AttributeDefinition(com.google.idea.blaze.base.lang.buildfile.language.semantics.AttributeDefinition) RuleDefinition(com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition) ImmutableMap(com.google.common.collect.ImmutableMap)

Aggregations

RuleDefinition (com.google.idea.blaze.base.lang.buildfile.language.semantics.RuleDefinition)7 ImmutableMap (com.google.common.collect.ImmutableMap)5 AttributeDefinition (com.google.idea.blaze.base.lang.buildfile.language.semantics.AttributeDefinition)2 BuildLanguageSpec (com.google.idea.blaze.base.lang.buildfile.language.semantics.BuildLanguageSpec)1 Argument (com.google.idea.blaze.base.lang.buildfile.psi.Argument)1 Expression (com.google.idea.blaze.base.lang.buildfile.psi.Expression)1 FuncallExpression (com.google.idea.blaze.base.lang.buildfile.psi.FuncallExpression)1 PsiElement (com.intellij.psi.PsiElement)1 TreeSet (java.util.TreeSet)1 Nullable (javax.annotation.Nullable)1