mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-113483 (action fixed to select directories too)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user