@Override
	public void addProposals(String dsl, CheckpointedStreamDefinitionException exception, CompletionKind kind, int detailLevel,
			List<String> proposals) {
		String safe = exception.getExpressionStringUntilCheckpoint();
		List<Token> tokens = exception.getTokens();
		int tokenPointer = tokens.size() - 1;
		while (!tokens.get(tokenPointer - 1).isKind(TokenKind.DOUBLE_MINUS)) {
			tokenPointer--;
		}

		StringBuilder prefix = null;
		for (prefix = new StringBuilder(); tokenPointer < tokens.size(); tokenPointer++) {
			Token t = tokens.get(tokenPointer);
			if (t.isIdentifier()) {
				prefix.append(t.stringValue());
			}
			else {
				prefix.append(t.getKind().getTokenChars());
			}
		}

		List<ModuleDescriptor> parsed = parser.parse("__dummy", safe, toParsingContext(kind));

		// List is in reverse order
		ModuleDescriptor lastModule = parsed.get(0);
		String lastModuleName = lastModule.getModuleName();
		ModuleType lastModuleType = lastModule.getType();
		ModuleDefinition lastModuleDefinition = moduleRegistry.findDefinition(lastModuleName, lastModuleType);

		Set<String> alreadyPresentOptions = new HashSet<String>(lastModule.getParameters().keySet());
		for (ModuleOption option : moduleOptionsMetadataResolver.resolve(lastModuleDefinition)) {
			if (shouldShowOption(option, detailLevel) && !alreadyPresentOptions.contains(option.getName())
					&& option.getName().startsWith(prefix.toString())) {
				proposals.add(String.format("%s --%s=", safe, option.getName()));
			}
		}

	}
Construct a new UnfinishedOptionNameRecoveryStrategy given the parser

@param parser the parser used to parse the text the partial module definition.
@param moduleRegistry the registry to check for the existence of the last entered module
       definition.
@param moduleOptionsMetadataResolver the metadata resolver to use in order to create a list of proposals for
       module options that have not yet been specified.
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/completion/UnfinishedOptionNameRecoveryStrategy.java