Skip to content

Commit 4b427b4

Browse files
committed
feat(smartpaste): add SmartCopyPasteProcessor
Add SmartCopyPasteProcessor class for handling copy-paste post-processing in IntelliJ.
1 parent 268495c commit 4b427b4

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/233/main/resources/META-INF/autodev-core.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
<!-- Run Configurations -->
5252
<programRunner implementation="cc.unitmesh.devti.runconfig.AutoDevCommandRunner"/>
5353

54+
<!-- <copyPastePostProcessor implementation="cc.unitmesh.devti.smartpaste.SmartCopyPasteProcessor"/>-->
55+
5456
<toolWindow id="AutoDev"
5557
doNotActivateOnStart="true"
5658
anchor="right"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cc.unitmesh.devti.smartpaste
2+
3+
import com.intellij.codeInsight.editorActions.CopyPastePostProcessor
4+
import com.intellij.codeInsight.editorActions.TextBlockTransferableData
5+
import com.intellij.openapi.editor.Editor
6+
import com.intellij.openapi.project.DumbService
7+
import com.intellij.psi.PsiFile
8+
9+
class SmartCopyPasteProcessor : CopyPastePostProcessor<TextBlockTransferableData>() {
10+
override fun collectTransferableData(
11+
file: PsiFile,
12+
editor: Editor,
13+
startOffsets: IntArray,
14+
endOffsets: IntArray
15+
): List<TextBlockTransferableData> {
16+
if (DumbService.isDumb(file.project)) return emptyList()
17+
18+
return emptyList()
19+
}
20+
}

0 commit comments

Comments
 (0)