Skip to content

Commit

Permalink
detectRuntime for launchSettings.json (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
van800 committed Jan 18, 2024
1 parent 68070d1 commit 50479fd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
@@ -0,0 +1,22 @@
package com.jetbrains.rider.plugins.godot.run

import com.intellij.openapi.project.Project
import com.jetbrains.rider.model.RdTargetFrameworkId
import com.jetbrains.rider.model.RunnableProjectKind
import com.jetbrains.rider.plugins.godot.GodotProjectDiscoverer
import com.jetbrains.rider.runtime.DotNetRuntimeAutodetect
import com.jetbrains.rider.runtime.RiderDotNetActiveRuntimeHost
import com.jetbrains.rider.runtime.RuntimeDetectionResult
import com.jetbrains.rider.runtime.dotNetCore.DotNetCoreRuntime

class GodotDotNetRuntimeAutodetect(private val project: Project): DotNetRuntimeAutodetect {
override fun detectRuntime(dotNetCoreRuntime: DotNetCoreRuntime?, riderDotNetActiveRuntimeHost: RiderDotNetActiveRuntimeHost, projectKind: RunnableProjectKind?, tfm: RdTargetFrameworkId?, exePath: String): RuntimeDetectionResult? {
if (dotNetCoreRuntime == null)
return null

if (GodotProjectDiscoverer.getInstance(project).godotCorePath.value != null)
return RuntimeDetectionResult.create(dotNetCoreRuntime)

return null
}
}
2 changes: 2 additions & 0 deletions rider/src/main/resources/META-INF/plugin.xml
Expand Up @@ -34,6 +34,8 @@

<rd.solutionExtListener endpoint="IDE Frontend"
listener="com.jetbrains.rider.plugins.godot.GodotProjectDiscoverer$ProtocolListener"/>

<rider.runtime.dotNetRuntimeAutodetect implementation="com.jetbrains.rider.plugins.godot.run.GodotDotNetRuntimeAutodetect"/>
</extensions>


Expand Down

0 comments on commit 50479fd

Please sign in to comment.