@Override
public void addProposals(String start, List<ModuleDescriptor> parseResult, CompletionKind kind, int detailLevel,
List<String> proposals) {
// List is in reverse order
ModuleDescriptor lastModule = parseResult.get(0);
ModuleType lastModuleType = lastModule.getType();
// For full streams, add processors and sinks
if (kind == stream && lastModuleType != ModuleType.sink) {
addAllModulesOfType(start.endsWith(" ") ? start + "| " : start + " | ", processor, proposals);
addAllModulesOfType(start.endsWith(" ") ? start + "| " : start + " | ", sink, proposals);
}
// For composed modules, don't go up to sink if we started with a source
ModuleDescriptor firstModule = parseResult.get(parseResult.size() - 1);
ModuleType firstModuleType = firstModule.getType();
if (kind == module && lastModuleType != ModuleType.sink) {
addAllModulesOfType(start.endsWith(" ") ? start + "| " : start + " | ", processor, proposals);
if (firstModuleType != source) {
addAllModulesOfType(start.endsWith(" ") ? start + "| " : start + " | ", sink, proposals);
}