use of com.thoughtworks.gauge.language.psi.ConceptDynamicArg in project Intellij-Plugin by getgauge.
the class ConceptDynamicArgCompletionProvider method addCompletions.
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
String prefix = getPrefix(parameters);
resultSet = resultSet.withPrefixMatcher(new PlainPrefixMatcher(prefix));
Collection<ConceptDynamicArg> args = PsiTreeUtil.collectElementsOfType(parameters.getOriginalFile(), ConceptDynamicArg.class);
for (ConceptDynamicArg arg : args) {
LookupElementBuilder item = LookupElementBuilder.create(arg.getText().replaceAll("<|>", ""));
resultSet.addElement(item);
}
}
Aggregations