File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
kotlin/cc/unitmesh/kotlin/indexer/provider Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ package cc.unitmesh.kotlin.indexer.provider
2
+
3
+ import cc.unitmesh.devti.indexer.provider.LangDictProvider
4
+ import com.intellij.openapi.application.runReadAction
5
+ import com.intellij.openapi.project.Project
6
+ import com.intellij.psi.search.FileTypeIndex
7
+ import com.intellij.psi.search.ProjectScope
8
+ import org.jetbrains.kotlin.idea.KotlinFileType
9
+
10
+ class KotlinLangDictProvider : LangDictProvider {
11
+ override suspend fun collectFileNames (project : Project ): List <String > {
12
+ val searchScope = ProjectScope .getProjectScope(project)
13
+ val javaFiles = runReadAction {
14
+ FileTypeIndex .getFiles(KotlinFileType .INSTANCE , searchScope)
15
+ }
16
+
17
+ val filenames = javaFiles.mapNotNull {
18
+ it.nameWithoutExtension
19
+ }
20
+
21
+ return filenames
22
+ }
23
+ }
Original file line number Diff line number Diff line change 45
45
<customPromptProvider
46
46
language =" kotlin"
47
47
implementationClass =" cc.unitmesh.kotlin.provider.KotlinCustomPromptProvider" />
48
+
49
+ <langDictProvider implementation =" cc.unitmesh.kotlin.indexer.provider.KotlinLangDictProvider" />
48
50
</extensions >
49
51
</idea-plugin >
You can’t perform that action at this time.
0 commit comments