Skip to content

Commit

Permalink
more config file extensions (#98)
Browse files Browse the repository at this point in the history
* more config file extensions

* add changelog

---------

Co-authored-by: Aviram Hassan <[email protected]>
  • Loading branch information
asinbow and aviramha authored Sep 20, 2023
1 parent 032b262 commit 0d2e92a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/+support-yaml-and-toml.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for TOML and YAML mirrord configuration files
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class MirrordConfigAPI(private val service: MirrordProjectService) {
fun getDefaultConfig(): VirtualFile? {
return getMirrordDir()
?.children
?.filter { it.name.endsWith("mirrord.json") }
?.filter { it.name.endsWith("mirrord.json") || it.name.endsWith("mirrord.yaml") || it.name.endsWith("mirrord.toml") }
?.minByOrNull { it.name }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ class MirrordConfigIndex : ScalarIndexExtension<String>() {

override fun getInputFilter(): FileBasedIndex.InputFilter {
return FileBasedIndex.InputFilter {
it.isInLocalFileSystem && !it.isDirectory && it.path.endsWith("mirrord.json")
it.isInLocalFileSystem && !it.isDirectory && (
it.path.endsWith("mirrord.json") ||
it.path.endsWith("mirrord.yaml") ||
it.path.endsWith("mirrord.toml")
)
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/META-INF/mirrord-maven.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<runConfigurationExtension implementation="com.metalbear.mirrord.products.idea.IdeaRunConfigurationExtension" id="mirrordIdea"/>
<executionEnvironmentProvider implementation="com.metalbear.mirrord.products.idea.MavenRunConfigurationExtension"/>
</extensions>
</idea-plugin>

0 comments on commit 0d2e92a

Please sign in to comment.