Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACT & UI: Add "Show Setting" action for Cargo
- Loading branch information
1 parent
2a811cc
commit 7f899cc
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/kotlin/org/rust/ide/actions/CargoEditSettingsAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Use of this source code is governed by the MIT license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
package org.rust.ide.actions | ||
|
||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.options.ShowSettingsUtil | ||
import com.intellij.openapi.project.DumbAware | ||
import org.rust.cargo.project.configurable.CargoConfigurable | ||
|
||
class CargoEditSettingsAction : AnAction(), DumbAware { | ||
|
||
override fun update(e: AnActionEvent) { | ||
super.update(e) | ||
e.presentation.isEnabledAndVisible = e.project != null | ||
} | ||
|
||
override fun actionPerformed(e: AnActionEvent) { | ||
ShowSettingsUtil.getInstance().showSettingsDialog(e.project, CargoConfigurable.DISPLAY_NAME) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters