Java inspection: When the element to be processed by information-level inspections is a whitespace (and the caret is at the start of the white space) process the nearest previous non-space element instead. (IDEA-157727)

This commit is contained in:
Pavel Dolgov
2016-07-15 12:50:31 +03:00
parent 98fe96ff6a
commit aeefdbf06b
@@ -315,7 +315,7 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass {
if (HighlightingLevelManager.getInstance(project).shouldInspect(hostFile)) {
PsiElement adjustedElement = psiElement;
int adjustedOffset = offset;
if (psiElement instanceof PsiWhiteSpace) {
if (psiElement instanceof PsiWhiteSpace && offset == psiElement.getTextRange().getStartOffset()) {
final PsiElement prev = psiElement.getPrevSibling();
if (prev != null) {
adjustedElement = prev;