Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more config file extensions #98

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>