File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
core/src/main/kotlin/cc/unitmesh/devti/indexer Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ import com.intellij.openapi.project.guessProjectDir
16
16
import kotlinx.coroutines.launch
17
17
import cc.unitmesh.devti.AutoDevIcons
18
18
import com.intellij.openapi.actionSystem.Presentation
19
+ import com.intellij.openapi.diagnostic.logger
20
+ import kotlin.io.path.createDirectories
21
+ import kotlin.io.path.exists
19
22
20
23
class DomainDictGenerateAction : AnAction () {
21
24
init {
@@ -38,14 +41,21 @@ class DomainDictGenerateAction : AnAction() {
38
41
try {
39
42
updatePresentation(presentation, AutoDevIcons .InProgress , false )
40
43
AutoDevStatusService .notifyApplication(AutoDevStatus .InProgress )
41
-
44
+
45
+ logger<DomainDictGenerateAction >().debug(" Prompt: $prompt " )
46
+
42
47
val result = StringBuilder ()
43
48
LlmFactory .create(project).stream(prompt, " " ).collect {
44
49
result.append(it)
45
50
}
46
51
47
52
val dict = result.toString()
48
- val file = project.guessProjectDir()!! .toNioPath().resolve(baseDir).resolve(" domain.csv" ).toFile()
53
+ val resolve = project.guessProjectDir()!! .toNioPath().resolve(baseDir)
54
+ if (! resolve.exists()) {
55
+ resolve.createDirectories()
56
+ }
57
+
58
+ val file = resolve.resolve(" domain.csv" ).toFile()
49
59
if (! file.exists()) {
50
60
file.createNewFile()
51
61
}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import cc.unitmesh.devti.template.context.TemplateContext
9
9
import com.intellij.openapi.components.Service
10
10
import com.intellij.openapi.project.Project
11
11
import com.intellij.openapi.project.guessProjectDir
12
+ import com.intellij.openapi.diagnostic.logger
12
13
13
14
@Service(Service .Level .PROJECT )
14
15
class PromptEnhancer (val project : Project ) {
You can’t perform that action at this time.
0 commit comments