mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
WEB-26756 ESLint: warning about new line character is now shown
- fix in editor (correctly set "after end of line" for annotation) - fix the same issue for batch inspection run - tests for batch eslint run to test annotation -> problem descriptor conversion
This commit is contained in:
+15
-6
@@ -92,23 +92,32 @@ public class ExternalAnnotatorInspectionVisitor extends PsiElementVisitor {
|
||||
IdentityHashMap<IntentionAction, LocalQuickFix> quickFixMappingCache = ContainerUtil.newIdentityHashMap();
|
||||
for (Annotation annotation : annotations) {
|
||||
if (annotation.getSeverity() == HighlightSeverity.INFORMATION ||
|
||||
annotation.getStartOffset() == annotation.getEndOffset()) {
|
||||
annotation.getStartOffset() == annotation.getEndOffset() && !annotation.isAfterEndOfLine()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final PsiElement startElement = file.findElementAt(annotation.getStartOffset());
|
||||
final PsiElement endElement = file.findElementAt(annotation.getEndOffset() - 1);
|
||||
final PsiElement startElement;
|
||||
final PsiElement endElement;
|
||||
if (annotation.getStartOffset() == annotation.getEndOffset() && annotation.isAfterEndOfLine()) {
|
||||
startElement = endElement = file.findElementAt(annotation.getEndOffset() - 1);
|
||||
} else {
|
||||
startElement = file.findElementAt(annotation.getStartOffset());
|
||||
endElement = file.findElementAt(annotation.getEndOffset() - 1);
|
||||
}
|
||||
if (startElement == null || endElement == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
LocalQuickFix[] quickFixes = toLocalQuickFixes(annotation.getQuickFixes(), quickFixMappingCache);
|
||||
ProblemDescriptor descriptor = manager.createProblemDescriptor(startElement,
|
||||
ProblemDescriptor descriptor = new ProblemDescriptorBase(startElement,
|
||||
endElement,
|
||||
annotation.getMessage(),
|
||||
quickFixes,
|
||||
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||
false,
|
||||
quickFixes);
|
||||
annotation.isAfterEndOfLine(),
|
||||
null,
|
||||
true,
|
||||
false);
|
||||
problems.add(descriptor);
|
||||
}
|
||||
return problems.toArray(new ProblemDescriptor[problems.size()]);
|
||||
|
||||
Reference in New Issue
Block a user