void (@NotNull final CommandConsole console) { final PsiFile consoleFile = console.getFile(); if (!(consoleFile instanceof CommandLineFile)) { throw new IllegalArgumentException( String.format("Passed argument is %s, but has to be %s", consoleFile.getClass(), CommandLineFile.class)); } final EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); final Color optionalColour = scheme.getAttributes(ConsoleHighlighter.GRAY).getForegroundColor(); final Color requiredColour = scheme.getAttributes(TemplateColors.TEMPLATE_VARIABLE_ATTRIBUTES).getForegroundColor(); console.getConsoleEditor().registerLineExtensionPainter(line -> { final PsiFile file = console.getFile(); if (file instanceof CommandLineFile) { final ValidationResult result = ((CommandLineFile)file).getValidationResult(); final Pair<Boolean, Argument> arg = result != null ? result.getNextArg() : null; if (arg != null) { final @NlsSafe String text = wrapBracesIfNeeded(arg.first, arg.second.getHelp().getHelpString()); final TextAttributes attributes = ConsoleViewContentType.USER_INPUT.getAttributes(); attributes.setForegroundColor(arg.first ? requiredColour : optionalColour); return Collections.singletonList(new LineExtensionInfo(" " + text, attributes)); } } return Collections.emptyList(); }); }