Skip to content

Commit 1a10085

Browse files
committed
fix: use default config for schema dumping
1 parent fb73557 commit 1a10085

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/kotlin/com/github/xepozz/mago/config/MagoSchemaHolder.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.github.xepozz.mago.config
22

3-
import com.github.xepozz.mago.composer.MagoComposerConfig
3+
import com.github.xepozz.mago.configuration.MagoProjectConfiguration
44
import com.intellij.execution.configurations.GeneralCommandLine
55
import com.intellij.execution.process.CapturingProcessAdapter
66
import com.intellij.execution.process.OSProcessHandler
@@ -9,7 +9,6 @@ import com.intellij.openapi.application.ApplicationManager
99
import com.intellij.openapi.components.Service
1010
import com.intellij.openapi.project.Project
1111
import com.intellij.openapi.project.ProjectManager
12-
import com.intellij.openapi.project.guessProjectDir
1312
import com.intellij.openapi.vfs.VirtualFile
1413
import com.intellij.testFramework.LightVirtualFile
1514
import com.jetbrains.jsonSchema.ide.JsonSchemaService
@@ -26,11 +25,14 @@ class MagoSchemaHolder(val project: Project) {
2625
// don't run dump several times
2726
if (run) return
2827
run = true
29-
val projectDir = project.guessProjectDir() ?: return
3028

29+
val magoConfiguration = MagoProjectConfiguration
30+
.getInstance(project)
31+
.findSelectedConfiguration(project)
32+
?: return
3133

3234
ApplicationManager.getApplication().executeOnPooledThread {
33-
val magoExecutable = MagoComposerConfig().getExecutablePath(projectDir.path + "/vendor")
35+
val magoExecutable = magoConfiguration.toolPath
3436

3537
val command = GeneralCommandLine().apply {
3638
exePath = magoExecutable

0 commit comments

Comments
 (0)