use of com.android.tools.klint.checks.BuiltinIssueRegistry in project kotlin by JetBrains.
the class LintInspectionDescriptionLinkHandler method getDescription.
@Override
public String getDescription(@NotNull final String refSuffix, @NotNull final Editor editor) {
final Project project = editor.getProject();
if (project == null) {
LOG.error(editor);
return null;
}
final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) {
return null;
}
Issue issue = new BuiltinIssueRegistry().getIssue(refSuffix);
if (issue != null) {
String html = issue.getExplanation(TextFormat.HTML);
// IntelliJ seems to treat newlines in the HTML as needing to also be converted to <br> (whereas
// Lint includes these for HTML readability but they shouldn't add additional lines since it has
// already added <br> as well) so strip these out
html = html.replace("\n", "");
return html;
}
// TODO: What about custom registries for custom rules, AARs etc?
LOG.warn("No description for inspection '" + refSuffix + "'");
return InspectionsBundle.message("inspection.tool.description.under.construction.text");
}
Aggregations