revert (WI-4622)

This commit is contained in:
anna
2011-02-21 20:27:08 +01:00
parent 1758aa4e20
commit 8f6e4a270c
2 changed files with 8 additions and 1 deletions
@@ -160,6 +160,13 @@ public class ProblemDescriptorImpl extends CommonProblemDescriptorImpl implement
return myEnforcedTextAttributes;
}
public TextRange getTextRangeForNavigation() {
TextRange textRange = getTextRange();
if (textRange == null) return null;
PsiElement element = getPsiElement();
return InjectedLanguageManager.getInstance(element.getProject()).injectedToHost(element, element.getTextRange());
}
public TextRange getTextRange() {
PsiElement startElement = getStartElement();
PsiElement endElement = myEndSmartPointer == null ? startElement : getEndElement();
@@ -645,7 +645,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
if (virtualFile != null) {
int startOffset = psiElement.getTextOffset();
if (descriptor instanceof ProblemDescriptorImpl) {
final TextRange textRange = ((ProblemDescriptorImpl)descriptor).getTextRange();
final TextRange textRange = ((ProblemDescriptorImpl)descriptor).getTextRangeForNavigation();
if (textRange != null) {
if (virtualFile instanceof VirtualFileWindow) {
virtualFile = ((VirtualFileWindow)virtualFile).getDelegate();