mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-349813 vcs: enable 'Rename File' and other PsiFile-dependent actions in LocalChanges tree context
PsiFileRule is a 'GetDataRuleType.PROVIDER' so it requires both VirtualFile and Project being provided by the same DataProvider instance. GitOrigin-RevId: 21a524e8bae47d04176cf7feb85027966cdab5d5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e0ea0e8899
commit
b87e7d556d
-2
@@ -3,7 +3,6 @@ package com.intellij.openapi.vcs.changes.savedPatches
|
||||
|
||||
import com.intellij.ide.util.treeView.TreeState
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.ClearableLazyValue
|
||||
import com.intellij.openapi.util.Disposer
|
||||
@@ -65,7 +64,6 @@ class SavedPatchesTree(project: Project,
|
||||
val selectedObjects = selectedPatchObjects()
|
||||
val data = visibleProvidersList.firstNotNullOfOrNull { provider -> provider.getData(dataId, selectedObjects) }
|
||||
if (data != null) return data
|
||||
if (CommonDataKeys.PROJECT.`is`(dataId)) return myProject
|
||||
return super.getData(dataId)
|
||||
}
|
||||
|
||||
|
||||
@@ -814,6 +814,9 @@ public abstract class ChangesTree extends Tree implements DataProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getData(@NotNull String dataId) {
|
||||
if (CommonDataKeys.PROJECT.is(dataId)) {
|
||||
return myProject;
|
||||
}
|
||||
if (PlatformDataKeys.COPY_PROVIDER.is(dataId)) {
|
||||
return myTreeCopyProvider;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user