/** * Parses single entries and removes git output prefixes. * * @param text input data * @return single unignored entry */ @Nullable @Override protected String parseOutput(@NotNull String text) { return StringUtil.trim(StringUtil.trimStart(text, GIT_UNIGNORED_FILES_PREFIX)); } }
@NotNull private static String prepareVarOrConstDeclarationText(@NotNull String name, @Nullable String type, @Nullable String value) { type = StringUtil.trim(type); value = StringUtil.trim(value); type = StringUtil.isNotEmpty(type) ? " " + type : ""; value = StringUtil.isNotEmpty(value) ? " = " + value : ""; return name + type + value; }
@Nullable @Override public String fun(@Nullable String s) { return trim(s); } };
private Optional<Problem> parseProblem(final String lint, final PsiFile file) { final Pattern p = Pattern.compile("\\w+\\.d\\((\\d+):(\\d+)\\)\\[(\\w+)\\]:(.+)"); final Matcher m = p.matcher(lint); if (m.find()) { final int line = Integer.valueOf(m.group(1)); final int column = Integer.valueOf(m.group(2)); final TextRange range = calculateTextRange(file, line, column); final String severity = m.group(3); final String message = StringUtil.trim(m.group(4)); final Problem problem = new Problem(range, message, severity); return Optional.of(problem); } return Optional.empty(); }
if (!force && empty && !advance) return false; String actual = trim(builder.getTokenText()); if (isEmpty(actual)) { sb.append(empty ? "unmatched input" : " expected");
final String lexerClassName = matcherClass.find() ? matcherClass.group(1) : null; Matcher matcherPackage = Pattern.compile("package\\s+([^;]+);|(%%)").matcher(text); final String lexerPackage = matcherPackage.find() ? StringUtil.trim(matcherPackage.group(1)) : null; if (lexerClassName == null) { String content = "Lexer class name option not found, use <pre>%class LexerClassName</pre>";