-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only use dotnetCoreRuntime, wait until rider is ready to ensure it is…
… loaded.
- Loading branch information
Showing
6 changed files
with
48 additions
and
185 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
15 changes: 0 additions & 15 deletions
15
Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierStartup.java
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/CSharpierStartup.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,40 @@ | ||
package com.intellij.csharpier | ||
|
||
import com.intellij.openapi.application.ApplicationManager | ||
import com.intellij.openapi.diagnostic.Logger | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.startup.StartupActivity | ||
import com.intellij.openapi.startup.StartupActivity.DumbAware | ||
import com.jetbrains.rd.platform.util.lifetime | ||
import com.jetbrains.rd.util.reactive.adviseUntil | ||
import com.jetbrains.rider.model.riderSolutionLifecycle | ||
import com.jetbrains.rider.projectView.solution | ||
import com.jetbrains.rider.runtime.RiderDotNetActiveRuntimeHost | ||
|
||
// kotlin because I have no idea how to get project.solution.riderSolutionLifecycle.isProjectModelReady.adviseUntil happy in java | ||
class CSharpierStartup : StartupActivity, DumbAware { | ||
var logger: Logger = CSharpierLogger.getInstance() | ||
|
||
override fun runActivity(project: Project) { | ||
project.solution.riderSolutionLifecycle.isProjectModelReady.adviseUntil(project.lifetime) { isReady -> | ||
|
||
val dotNetCoreRuntime = | ||
RiderDotNetActiveRuntimeHost.Companion.getInstance(project).dotNetCoreRuntime.value | ||
|
||
if (!isReady || dotNetCoreRuntime == null) { | ||
if (isReady) { | ||
logger.warn("isProjectModelReady is true, but dotNetCoreRuntime is still null"); | ||
} | ||
|
||
return@adviseUntil false | ||
} | ||
|
||
CSharpierProcessProvider.getInstance(project) | ||
ApplicationManager.getApplication().getService(ReformatWithCSharpierOnSave::class.java) | ||
DotNetProvider.getInstance(project).initialize(); | ||
|
||
return@adviseUntil true | ||
} | ||
} | ||
|
||
} |
150 changes: 0 additions & 150 deletions
150
Src/CSharpier.Rider/src/main/java/com/intellij/csharpier/DotNetFinder.java
This file was deleted.
Oops, something went wrong.
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
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