IDEA-113483 (action fixed to select directories too)

This commit is contained in:
Roman Shevchenko
2013-11-08 13:20:30 +01:00
parent 7bd9931904
commit ac7f1b245b
@@ -22,7 +22,7 @@ import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VFileProperty;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileSystemItem;
import com.intellij.psi.PsiManager;
public class GoToLinkTargetAction extends DumbAwareAction {
@@ -40,7 +40,8 @@ public class GoToLinkTargetAction extends DumbAwareAction {
if (project != null && file != null && file.is(VFileProperty.SYMLINK)) {
VirtualFile target = file.getCanonicalFile();
if (target != null) {
PsiFile psiFile = PsiManager.getInstance(project).findFile(target);
PsiManager psiManager = PsiManager.getInstance(project);
PsiFileSystemItem psiFile = target.isDirectory() ? psiManager.findDirectory(target) : psiManager.findFile(target);
if (psiFile != null) {
ProjectView.getInstance(project).select(psiFile, target, false);
}