use of com.jetbrains.commandInterface.commandLine.ValidationResult in project intellij-community by JetBrains.
the class CommandLinePsiImplUtils method getValidationResult.
/**
* Searches for validation result for command line
*
* @param commandLinePart command line part
* @return validation result (if any)
*/
@Nullable
private static ValidationResult getValidationResult(@NotNull final CommandLinePart commandLinePart) {
final CommandLineFile commandLineFile = commandLinePart.getCommandLineFile();
if (commandLineFile == null) {
return null;
}
final ValidationResult validationResult = commandLineFile.getValidationResult();
if (validationResult == null) {
return null;
}
return validationResult;
}
use of com.jetbrains.commandInterface.commandLine.ValidationResult in project intellij-community by JetBrains.
the class ArgumentHintLayer method modificationCountChanged.
@Override
public void modificationCountChanged() {
ApplicationManager.getApplication().assertIsDispatchThread();
final String newText = myConsole.getFile().getText();
if (newText.equals(myLastText)) {
// If text did not changed from last time, we do nothing
return;
}
// Store text for next time check
myLastText = newText;
// Reset current argument
myNextArg = null;
final PsiFile consoleFile = myConsole.getFile();
// Get next arg from file
if (consoleFile instanceof CommandLineFile) {
final ValidationResult result = ((CommandLineFile) consoleFile).getValidationResult();
myNextArg = result != null ? result.getNextArg() : null;
// We need to repaint us if argument changed
repaint();
}
}
Aggregations