use of org.springframework.ide.vscode.commons.languageserver.reconcile.ReconcileProblemImpl in project sts4 by spring-projects.
the class SchemaBasedYamlASTReconciler method valueParseError.
private void valueParseError(YType type, DocumentRegion region, String parseErrorMsg, ProblemType problemType, ReplacementQuickfix fix) {
if (!StringUtil.hasText(parseErrorMsg)) {
parseErrorMsg = "Couldn't parse as '" + describe(type) + "'";
}
ReconcileProblemImpl problem = YamlSchemaProblems.problem(problemType, parseErrorMsg, region);
if (fix != null && StringUtil.hasText(fix.replacement)) {
try {
problem.addQuickfix(new QuickfixData<>(quickfixes.SIMPLE_TEXT_EDIT, new ReplaceStringData(region, fix.replacement), fix.msg));
} catch (Exception e) {
Log.log(e);
}
}
problems.accept(problem);
}
Aggregations