From 4a2c92c3dddb46f62bda8d723ca5efe0f872fcde Mon Sep 17 00:00:00 2001 From: Cooper Oh Date: Sun, 8 Dec 2024 15:23:12 +0900 Subject: [PATCH] Rename profile to configEnvironment --- .../mise/core/command/MiseCommandLine.kt | 8 ++++---- .../core/command/MiseCommandLineHelper.kt | 12 +++++------ .../command/MiseRunTaskOnTerminalAction.kt | 8 ++++---- .../run/MiseRunConfigurationSettingsEditor.kt | 20 +++++++++---------- .../core/run/MiseRunConfigurationState.kt | 6 +++--- .../mise/core/setting/MiseConfigurable.kt | 12 +++++------ .../l34130/mise/core/setting/MiseSettings.kt | 6 +++--- .../core/setup/AbstractProjectSdkSetup.kt | 5 +++-- .../core/toolwindow/nodes/MiseRootNode.kt | 6 +++--- .../run/GoLandRunConfigurationExtension.kt | 8 ++++---- .../gradle/run/GradleEnvironmentProvider.kt | 8 ++++---- .../idea/run/IdeaRunConfigurationExtension.kt | 8 ++++---- .../run/NodeRunConfigurationExtension.kt | 8 ++++---- .../run/RiderPatchCommandLineExtension.kt | 2 +- .../MiseConfigCompletionProvider.kt | 4 ++-- .../toml/editor/MiseRunLineMarkerProvider.kt | 4 ++-- 16 files changed, 63 insertions(+), 62 deletions(-) diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseCommandLine.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseCommandLine.kt index 9654cd91..d1e98ab2 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseCommandLine.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseCommandLine.kt @@ -12,7 +12,7 @@ private val LOG = Logger.getInstance(MiseCommandLine::class.java) internal class MiseCommandLine( private val workDir: String? = null, - private val miseEnv: String? = null, + private val configEnvironment: String? = null, ) { inline fun runCommandLine(vararg params: String): Result = runCommandLine(params.toList()) @@ -22,13 +22,13 @@ internal class MiseCommandLine( val commandLineArgs = mutableListOf("mise") - if (miseEnv != null) { + if (configEnvironment != null) { if (miseVersion >= MiseVersion(2024, 12, 2)) { commandLineArgs.add("--env") - commandLineArgs.add(miseEnv) + commandLineArgs.add(configEnvironment) } else { commandLineArgs.add("--profile") - commandLineArgs.add(miseEnv) + commandLineArgs.add(configEnvironment) } } diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseCommandLineHelper.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseCommandLineHelper.kt index c2514f16..997551c3 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseCommandLineHelper.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseCommandLineHelper.kt @@ -2,15 +2,15 @@ package com.github.l34130.mise.core.command object MiseCommandLineHelper { // mise env - fun getEnvVars(workDir: String?, profile: String?): Result> { + fun getEnvVars(workDir: String?, configEnvironment: String?): Result> { val commandLineArgs = mutableListOf("env", "--json") - val miseCommandLine = MiseCommandLine(workDir, profile) + val miseCommandLine = MiseCommandLine(workDir, configEnvironment) return miseCommandLine.runCommandLine(commandLineArgs) } // mise ls - fun getDevTools(workDir: String?, profile: String?): Result>> { + fun getDevTools(workDir: String?, configEnvironment: String?): Result>> { val commandLineArgs = mutableListOf("ls", "--current", "--json") val miseVersion = MiseCommandLine.getMiseVersion() @@ -21,7 +21,7 @@ object MiseCommandLineHelper { commandLineArgs.add("--offline") } - val miseCommandLine = MiseCommandLine(workDir, profile) + val miseCommandLine = MiseCommandLine(workDir, configEnvironment) return miseCommandLine.runCommandLine>>(commandLineArgs) .map { devTools -> devTools.mapKeys { (toolName, _) -> MiseDevToolName(toolName) } @@ -29,10 +29,10 @@ object MiseCommandLineHelper { } // mise task ls - fun getTasks(workDir: String?, profile: String?): Result> { + fun getTasks(workDir: String?, configEnvironment: String?): Result> { val commandLineArgs = mutableListOf("task", "ls", "--json") - val miseCommandLine = MiseCommandLine(workDir, profile) + val miseCommandLine = MiseCommandLine(workDir, configEnvironment) return miseCommandLine.runCommandLine(commandLineArgs) } } diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseRunTaskOnTerminalAction.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseRunTaskOnTerminalAction.kt index fac7e4f3..ddf4764d 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseRunTaskOnTerminalAction.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/command/MiseRunTaskOnTerminalAction.kt @@ -9,7 +9,7 @@ import com.intellij.openapi.project.Project class MiseRunTaskOnTerminalAction( private val taskName: String, - private val profile: String? = null, + private val configEnvironment: String? = null, ) : DumbAwareAction( "Run Mise Task", "Execute the Mise task on Terminal", @@ -22,7 +22,7 @@ class MiseRunTaskOnTerminalAction( return } - executeTask(project, taskName, profile) + executeTask(project, taskName, configEnvironment) } companion object { @@ -31,12 +31,12 @@ class MiseRunTaskOnTerminalAction( fun executeTask( project: Project, taskName: String, - profile: String? = null, + configEnvironment: String? = null, ) { val command = buildString { append("mise run") - profile?.let { append(" --profile '$it'") } + configEnvironment?.let { append(" --profile '$it'") } // TODO: Handle mise config environment append(" '$taskName'") } diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/run/MiseRunConfigurationSettingsEditor.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/run/MiseRunConfigurationSettingsEditor.kt index 45d16a9b..233d503a 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/run/MiseRunConfigurationSettingsEditor.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/run/MiseRunConfigurationSettingsEditor.kt @@ -26,7 +26,7 @@ class MiseRunConfigurationSettingsEditor>( private val project: Project, ) : SettingsEditor() { private val myMiseDirEnvCb = JBCheckBox("Use environment variables from mise") - private val myMiseProfileTf = JBTextField() + private val myMiseConfigEnvironmentTf = JBTextField() override fun createEditor(): JComponent { val projectState = MiseSettings.getService(project).state @@ -42,8 +42,8 @@ class MiseRunConfigurationSettingsEditor>( cell(myMiseDirEnvCb) .comment("Load environment variables from mise configuration file(s)") }.enabled(isOverridden.not()) - row("Profile: ") { - cell(myMiseProfileTf) + row("Config Environment:") { + cell(myMiseConfigEnvironmentTf) .comment( """ Specify the mise configuration environment to use (leave empty for default)
@@ -68,7 +68,7 @@ class MiseRunConfigurationSettingsEditor>( USER_DATA_KEY, MiseRunConfigurationState( useMiseDirEnv = myMiseDirEnvCb.isSelected, - miseProfile = myMiseProfileTf.text, + miseConfigEnvironment = myMiseConfigEnvironmentTf.text, ), ) } @@ -80,14 +80,14 @@ class MiseRunConfigurationSettingsEditor>( val state = userData.mergeProjectState(projectState) myMiseDirEnvCb.isSelected = state.useMiseDirEnv - myMiseProfileTf.text = state.miseProfile + myMiseConfigEnvironmentTf.text = state.miseConfigEnvironment if (!myMiseDirEnvCb.isSelected) { - myMiseProfileTf.isEnabled = false + myMiseConfigEnvironmentTf.isEnabled = false } if (projectState.useMiseDirEnv) { myMiseDirEnvCb.isEnabled = false - myMiseProfileTf.isEnabled = false + myMiseConfigEnvironmentTf.isEnabled = false } } @@ -100,11 +100,11 @@ class MiseRunConfigurationSettingsEditor>( element: Element, ) { val miseDirEnvCb = element.getAttributeValue("myMiseDirEnvCb")?.toBoolean() ?: false - val miseProfile = element.getAttributeValue("myMiseProfileTf") ?: "" + val miseConfigEnvironment = element.getAttributeValue("myMiseConfigEnvironmentTf") ?: "" val state = MiseRunConfigurationState( useMiseDirEnv = miseDirEnvCb, - miseProfile = miseProfile, + miseConfigEnvironment = miseConfigEnvironment, ) runConfiguration.putCopyableUserData(USER_DATA_KEY, state) } @@ -116,7 +116,7 @@ class MiseRunConfigurationSettingsEditor>( val userData = runConfiguration.getCopyableUserData(USER_DATA_KEY) ?: return element.setAttribute("myMiseDirEnvCb", userData.useMiseDirEnv.toString()) - element.setAttribute("myMiseProfileTf", userData.miseProfile) + element.setAttribute("myMiseConfigEnvironmentTf", userData.miseConfigEnvironment) } fun getMiseRunConfigurationState(configuration: RunConfigurationBase<*>): MiseRunConfigurationState? = diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/run/MiseRunConfigurationState.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/run/MiseRunConfigurationState.kt index b8c676f6..b812de8b 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/run/MiseRunConfigurationState.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/run/MiseRunConfigurationState.kt @@ -4,17 +4,17 @@ import com.github.l34130.mise.core.setting.MiseState data class MiseRunConfigurationState( var useMiseDirEnv: Boolean = true, - var miseProfile: String = "", + var miseConfigEnvironment: String = "", ) : Cloneable { public override fun clone() = MiseRunConfigurationState( useMiseDirEnv = useMiseDirEnv, - miseProfile = miseProfile, + miseConfigEnvironment = miseConfigEnvironment, ) fun mergeProjectState(projectState: MiseState): MiseRunConfigurationState = this.copy( useMiseDirEnv = projectState.useMiseDirEnv, - miseProfile = projectState.miseProfile, + miseConfigEnvironment = projectState.miseConfigEnvironment, ) } diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/setting/MiseConfigurable.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/setting/MiseConfigurable.kt index ee613b41..6008d63e 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/setting/MiseConfigurable.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/setting/MiseConfigurable.kt @@ -18,7 +18,7 @@ class MiseConfigurable( private val project: Project, ) : SearchableConfigurable { private val myMiseDirEnvCb = JBCheckBox("Use environment variables from mise") - private val myMiseProfileTf = JBTextField() + private val myMiseConfigEnvironmentTf = JBTextField() override fun getDisplayName(): String = "Mise Settings" @@ -26,7 +26,7 @@ class MiseConfigurable( val service = MiseSettings.getService(project) myMiseDirEnvCb.isSelected = service.state.useMiseDirEnv - myMiseProfileTf.text = service.state.miseProfile + myMiseConfigEnvironmentTf.text = service.state.miseConfigEnvironment return JPanel(BorderLayout()).apply { add( @@ -56,8 +56,8 @@ class MiseConfigurable( "Load environment variables from mise configuration file(s)", ) } - row("Profile:") { - cell(myMiseProfileTf) + row("Config Environment:") { + cell(myMiseConfigEnvironmentTf) .comment( """ Specify the mise configuration environment to use (leave empty for default)
@@ -76,14 +76,14 @@ class MiseConfigurable( override fun isModified(): Boolean { val service = MiseSettings.getService(project) return myMiseDirEnvCb.isSelected != service.state.useMiseDirEnv || - myMiseProfileTf.text != service.state.miseProfile + myMiseConfigEnvironmentTf.text != service.state.miseConfigEnvironment } override fun apply() { if (isModified) { val service = MiseSettings.getService(project) service.state.useMiseDirEnv = myMiseDirEnvCb.isSelected - service.state.miseProfile = myMiseProfileTf.text + service.state.miseConfigEnvironment = myMiseConfigEnvironmentTf.text } } diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/setting/MiseSettings.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/setting/MiseSettings.kt index 62db0fa5..2e2dc250 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/setting/MiseSettings.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/setting/MiseSettings.kt @@ -17,13 +17,13 @@ import java.io.File data class MiseState( var executablePath: String = "", var useMiseDirEnv: Boolean = true, - var miseProfile: String = "", + var miseConfigEnvironment: String = "", ) : Cloneable { public override fun clone(): MiseState = MiseState( executablePath = executablePath, useMiseDirEnv = useMiseDirEnv, - miseProfile = miseProfile, + miseConfigEnvironment = miseConfigEnvironment, ) } @@ -50,7 +50,7 @@ class MiseSettings( state = MiseState( executablePath = state.executablePath.takeIf { it.isNotEmpty() } ?: getMiseExecutablePath() ?: "", useMiseDirEnv = state.useMiseDirEnv, - miseProfile = state.miseProfile, + miseConfigEnvironment = state.miseConfigEnvironment, ) if (state.executablePath.isEmpty()) { diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/setup/AbstractProjectSdkSetup.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/setup/AbstractProjectSdkSetup.kt index 129c4499..13291b45 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/setup/AbstractProjectSdkSetup.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/setup/AbstractProjectSdkSetup.kt @@ -49,8 +49,9 @@ abstract class AbstractProjectSdkSetup : val devToolName = getDevToolName() val miseNotificationService = project.service() - val profile = MiseSettings.getService(project).state.miseProfile - val toolsResult = MiseCommandLineHelper.getDevTools(workDir = project.basePath, profile = profile) + val configEnvironment = MiseSettings.getService(project).state.miseConfigEnvironment + val toolsResult = + MiseCommandLineHelper.getDevTools(workDir = project.basePath, configEnvironment = configEnvironment) val tools = toolsResult.fold( onSuccess = { tools -> tools[devToolName] }, onFailure = { diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/toolwindow/nodes/MiseRootNode.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/toolwindow/nodes/MiseRootNode.kt index 4426026d..74cd912d 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/toolwindow/nodes/MiseRootNode.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/toolwindow/nodes/MiseRootNode.kt @@ -30,7 +30,7 @@ class MiseRootNode( private fun getToolNodes(settings: MiseSettings): Collection { val toolsByToolNames = MiseCommandLineHelper.getDevTools( workDir = nodeProject.basePath, - profile = settings.state.miseProfile + configEnvironment = settings.state.miseConfigEnvironment ).fold( onSuccess = { tools -> tools }, onFailure = { @@ -62,7 +62,7 @@ class MiseRootNode( private fun getEnvironmentNodes(settings: MiseSettings): Collection { val envs = MiseCommandLineHelper.getEnvVars( workDir = nodeProject.basePath, - profile = settings.state.miseProfile + configEnvironment = settings.state.miseConfigEnvironment ).fold( onSuccess = { envs -> envs }, onFailure = { @@ -85,7 +85,7 @@ class MiseRootNode( private fun getTaskNodes(settings: MiseSettings): Collection { val tasks = MiseCommandLineHelper.getTasks( workDir = nodeProject.basePath, - profile = settings.state.miseProfile + configEnvironment = settings.state.miseConfigEnvironment ).fold( onSuccess = { tasks -> tasks }, onFailure = { diff --git a/modules/products/goland/src/main/kotlin/com/github/l34130/mise/goland/run/GoLandRunConfigurationExtension.kt b/modules/products/goland/src/main/kotlin/com/github/l34130/mise/goland/run/GoLandRunConfigurationExtension.kt index e31e253c..4385d914 100644 --- a/modules/products/goland/src/main/kotlin/com/github/l34130/mise/goland/run/GoLandRunConfigurationExtension.kt +++ b/modules/products/goland/src/main/kotlin/com/github/l34130/mise/goland/run/GoLandRunConfigurationExtension.kt @@ -48,13 +48,13 @@ class GoLandRunConfigurationExtension : GoRunConfigurationExtension() { val projectState = project.service().state val runConfigState = MiseRunConfigurationSettingsEditor.getMiseRunConfigurationState(configuration) - val (workDir, profile) = when { - projectState.useMiseDirEnv -> project.basePath to projectState.miseProfile - runConfigState?.useMiseDirEnv == true -> configuration.getWorkingDirectory() to runConfigState.miseProfile + val (workDir, configEnvironment) = when { + projectState.useMiseDirEnv -> project.basePath to projectState.miseConfigEnvironment + runConfigState?.useMiseDirEnv == true -> configuration.getWorkingDirectory() to runConfigState.miseConfigEnvironment else -> return } - MiseCommandLineHelper.getEnvVars(workDir, profile) + MiseCommandLineHelper.getEnvVars(workDir, configEnvironment) .fold( onSuccess = { envVars -> envVars }, onFailure = { diff --git a/modules/products/gradle/src/main/kotlin/com/github/l34130/mise/gradle/run/GradleEnvironmentProvider.kt b/modules/products/gradle/src/main/kotlin/com/github/l34130/mise/gradle/run/GradleEnvironmentProvider.kt index f0c97ea0..def4d5a4 100644 --- a/modules/products/gradle/src/main/kotlin/com/github/l34130/mise/gradle/run/GradleEnvironmentProvider.kt +++ b/modules/products/gradle/src/main/kotlin/com/github/l34130/mise/gradle/run/GradleEnvironmentProvider.kt @@ -36,17 +36,17 @@ class GradleEnvironmentProvider : GradleExecutionEnvironmentProvider { val projectState = project.service().state val runConfigState = MiseRunConfigurationSettingsEditor.getMiseRunConfigurationState(gradleRunConfiguration) - val (workDir, profile) = when { - projectState.useMiseDirEnv -> project.basePath to projectState.miseProfile + val (workDir, configEnvironment) = when { + projectState.useMiseDirEnv -> project.basePath to projectState.miseConfigEnvironment runConfigState?.useMiseDirEnv == true -> { val sourceConfig = task.runProfile as ApplicationConfiguration - sourceConfig.project.basePath to runConfigState.miseProfile + sourceConfig.project.basePath to runConfigState.miseConfigEnvironment } else -> return environment } - val miseEnvVars = MiseCommandLineHelper.getEnvVars(workDir, profile) + val miseEnvVars = MiseCommandLineHelper.getEnvVars(workDir, configEnvironment) .fold( onSuccess = { envVars -> envVars }, onFailure = { diff --git a/modules/products/idea/src/main/kotlin/com/github/l34130/mise/idea/run/IdeaRunConfigurationExtension.kt b/modules/products/idea/src/main/kotlin/com/github/l34130/mise/idea/run/IdeaRunConfigurationExtension.kt index 50275cfd..144dcf2f 100644 --- a/modules/products/idea/src/main/kotlin/com/github/l34130/mise/idea/run/IdeaRunConfigurationExtension.kt +++ b/modules/products/idea/src/main/kotlin/com/github/l34130/mise/idea/run/IdeaRunConfigurationExtension.kt @@ -57,13 +57,13 @@ class IdeaRunConfigurationExtension : RunConfigurationExtension() { val projectState = project.service().state val runConfigState = MiseRunConfigurationSettingsEditor.getMiseRunConfigurationState(configuration) - val (workDir, profile) = when { - projectState.useMiseDirEnv -> project.basePath to projectState.miseProfile - runConfigState?.useMiseDirEnv == true -> params.workingDirectory to runConfigState.miseProfile + val (workDir, configEnvironment) = when { + projectState.useMiseDirEnv -> project.basePath to projectState.miseConfigEnvironment + runConfigState?.useMiseDirEnv == true -> params.workingDirectory to runConfigState.miseConfigEnvironment else -> return } - val envVars = MiseCommandLineHelper.getEnvVars(workDir, profile) + val envVars = MiseCommandLineHelper.getEnvVars(workDir, configEnvironment) .fold( onSuccess = { envVars -> envVars }, onFailure = { diff --git a/modules/products/nodejs/src/main/kotlin/com/github/l34130/mise/nodejs/run/NodeRunConfigurationExtension.kt b/modules/products/nodejs/src/main/kotlin/com/github/l34130/mise/nodejs/run/NodeRunConfigurationExtension.kt index aa05f593..7bae9b25 100644 --- a/modules/products/nodejs/src/main/kotlin/com/github/l34130/mise/nodejs/run/NodeRunConfigurationExtension.kt +++ b/modules/products/nodejs/src/main/kotlin/com/github/l34130/mise/nodejs/run/NodeRunConfigurationExtension.kt @@ -49,16 +49,16 @@ class NodeRunConfigurationExtension : AbstractNodeRunConfigurationExtension() { val projectState = project.service().state val runConfigState = MiseRunConfigurationSettingsEditor.getMiseRunConfigurationState(configuration) - val (workDir, profile) = + val (workDir, configEnvironment) = when { - projectState.useMiseDirEnv -> project.basePath to projectState.miseProfile - runConfigState?.useMiseDirEnv == true -> environment.modulePath to runConfigState.miseProfile + projectState.useMiseDirEnv -> project.basePath to projectState.miseConfigEnvironment + runConfigState?.useMiseDirEnv == true -> environment.modulePath to runConfigState.miseConfigEnvironment else -> return null } return object : NodeRunConfigurationLaunchSession() { override fun addNodeOptionsTo(targetRun: NodeTargetRun) { - val envVars = MiseCommandLineHelper.getEnvVars(workDir, profile) + val envVars = MiseCommandLineHelper.getEnvVars(workDir, configEnvironment) .fold( onSuccess = { envVars -> envVars }, onFailure = { diff --git a/modules/products/rider/src/main/kotlin/com/github/l34130/mise/rider/run/RiderPatchCommandLineExtension.kt b/modules/products/rider/src/main/kotlin/com/github/l34130/mise/rider/run/RiderPatchCommandLineExtension.kt index 9222a27b..6dba50ea 100644 --- a/modules/products/rider/src/main/kotlin/com/github/l34130/mise/rider/run/RiderPatchCommandLineExtension.kt +++ b/modules/products/rider/src/main/kotlin/com/github/l34130/mise/rider/run/RiderPatchCommandLineExtension.kt @@ -47,7 +47,7 @@ class RiderPatchCommandLineExtension : PatchCommandLineExtension { val miseEnvVars = MiseCommandLineHelper.getEnvVars( workDir = project.solutionDirectoryPath.toAbsolutePath().toString(), - profile = projectState.miseProfile + configEnvironment = projectState.miseConfigEnvironment ).fold( onSuccess = { envVars -> envVars }, onFailure = { diff --git a/modules/products/toml/src/main/kotlin/com/github/l34130/mise/toml/completion/MiseConfigCompletionProvider.kt b/modules/products/toml/src/main/kotlin/com/github/l34130/mise/toml/completion/MiseConfigCompletionProvider.kt index 0ca188fa..aa7c3300 100644 --- a/modules/products/toml/src/main/kotlin/com/github/l34130/mise/toml/completion/MiseConfigCompletionProvider.kt +++ b/modules/products/toml/src/main/kotlin/com/github/l34130/mise/toml/completion/MiseConfigCompletionProvider.kt @@ -30,12 +30,12 @@ class MiseConfigCompletionProvider : CompletionProvider() return } - val profile = MiseSettings.getService(root.project).state.miseProfile + val configEnvironment = MiseSettings.getService(root.project).state.miseConfigEnvironment // TODO: Store the tasks in a cache and update them only when the file changes // This will prevent unnecessary calls to the CLI or when the file is an invalid state val tasksFromMise = MiseCommandLineHelper.getTasks( workDir = root.project.basePath, - profile = profile, + configEnvironment = configEnvironment, ).fold( onSuccess = { tasks -> tasks }, onFailure = { emptyList() }, diff --git a/modules/products/toml/src/main/kotlin/com/github/l34130/mise/toml/editor/MiseRunLineMarkerProvider.kt b/modules/products/toml/src/main/kotlin/com/github/l34130/mise/toml/editor/MiseRunLineMarkerProvider.kt index 5b61b3b9..7e535efc 100644 --- a/modules/products/toml/src/main/kotlin/com/github/l34130/mise/toml/editor/MiseRunLineMarkerProvider.kt +++ b/modules/products/toml/src/main/kotlin/com/github/l34130/mise/toml/editor/MiseRunLineMarkerProvider.kt @@ -22,9 +22,9 @@ class MiseRunLineMarkerProvider : RunLineMarkerContributor() { val taskName = getTaskInfo(element) ?: return null val miseSettings = element.project.service() - val profile = miseSettings.state.miseProfile + val configEnvironment = miseSettings.state.miseConfigEnvironment - return Info(MiseRunTaskOnTerminalAction(taskName, profile)) + return Info(MiseRunTaskOnTerminalAction(taskName, configEnvironment)) } private fun getTaskInfo(element: LeafPsiElement): String? {