use of com.thoughtworks.gauge.language.psi.SpecTable in project Intellij-Plugin by getgauge.
the class DynamicArgCompletionProvider method addCompletions.
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
String prefix = getPrefix(parameters);
resultSet = resultSet.withPrefixMatcher(new PlainPrefixMatcher(prefix));
SpecDetail specDetail = PsiTreeUtil.getChildOfType(parameters.getOriginalFile(), SpecDetail.class);
if (specDetail == null)
return;
SpecTable table = specDetail.getDataTable();
if (table != null) {
List<String> headers = table.getTableHeader().getHeaders();
for (String header : headers) {
LookupElementBuilder item = LookupElementBuilder.create(header);
resultSet.addElement(item);
}
}
}
Aggregations