Search in sources :

Example 1 with SpecStaticArg

use of com.thoughtworks.gauge.language.psi.SpecStaticArg in project Intellij-Plugin by getgauge.

the class StaticArgCompletionProvider method getArgsFromSteps.

private Set<String> getArgsFromSteps(List<SpecStep> steps) {
    Set<String> staticArgs = new HashSet<>();
    for (SpecStep step : steps) {
        List<SpecStaticArg> args = step.getStaticArgList();
        args.stream().filter(arg -> arg.getText() != null).forEach((arg) -> staticArgs.add(arg.getText()));
    }
    return staticArgs;
}
Also used : ProcessingContext(com.intellij.util.ProcessingContext) StepCompletionContributor.getPrefix(com.thoughtworks.gauge.autocomplete.StepCompletionContributor.getPrefix) PlainPrefixMatcher(com.intellij.codeInsight.completion.PlainPrefixMatcher) SpecScenario(com.thoughtworks.gauge.language.psi.SpecScenario) LookupElementBuilder(com.intellij.codeInsight.lookup.LookupElementBuilder) SpecDetail(com.thoughtworks.gauge.language.psi.SpecDetail) CompletionParameters(com.intellij.codeInsight.completion.CompletionParameters) Set(java.util.Set) SpecStep(com.thoughtworks.gauge.language.psi.SpecStep) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) CompletionResultSet(com.intellij.codeInsight.completion.CompletionResultSet) PsiTreeUtil(com.intellij.psi.util.PsiTreeUtil) List(java.util.List) CompletionProvider(com.intellij.codeInsight.completion.CompletionProvider) PsiFile(com.intellij.psi.PsiFile) SpecStaticArg(com.thoughtworks.gauge.language.psi.SpecStaticArg) NotNull(org.jetbrains.annotations.NotNull) SpecStep(com.thoughtworks.gauge.language.psi.SpecStep) SpecStaticArg(com.thoughtworks.gauge.language.psi.SpecStaticArg) HashSet(java.util.HashSet)

Aggregations

CompletionParameters (com.intellij.codeInsight.completion.CompletionParameters)1 CompletionProvider (com.intellij.codeInsight.completion.CompletionProvider)1 CompletionResultSet (com.intellij.codeInsight.completion.CompletionResultSet)1 PlainPrefixMatcher (com.intellij.codeInsight.completion.PlainPrefixMatcher)1 LookupElementBuilder (com.intellij.codeInsight.lookup.LookupElementBuilder)1 PsiFile (com.intellij.psi.PsiFile)1 PsiTreeUtil (com.intellij.psi.util.PsiTreeUtil)1 ProcessingContext (com.intellij.util.ProcessingContext)1 StepCompletionContributor.getPrefix (com.thoughtworks.gauge.autocomplete.StepCompletionContributor.getPrefix)1 SpecDetail (com.thoughtworks.gauge.language.psi.SpecDetail)1 SpecScenario (com.thoughtworks.gauge.language.psi.SpecScenario)1 SpecStaticArg (com.thoughtworks.gauge.language.psi.SpecStaticArg)1 SpecStep (com.thoughtworks.gauge.language.psi.SpecStep)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 NotNull (org.jetbrains.annotations.NotNull)1