-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#138 Switch to modern Rider plugin architecture (from components to s…
…ervice) to avoid exception on plugin start-up.
- Loading branch information
Showing
11 changed files
with
75 additions
and
110 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
Extension/Xamarin.Forms.HotReload.Extension.Rider/CHANGELOG.md
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Changelog | ||
|
||
## 1.4.3 | ||
- Support for 2020.x version | ||
- Open end `until` version | ||
## 1.4.4 | ||
- Switch to up-to-date Rider plugin architecture | ||
- Fix bug, related to plugin start-up initialization |
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
2 changes: 1 addition & 1 deletion
2
Extension/Xamarin.Forms.HotReload.Extension.Rider/gradle.properties
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Properties for the build. Override on the command line with -Pprop=value | ||
# E.g. -PBuildConfiguration=Release | ||
# Note that these values are strings! | ||
productVersion=2020.1 | ||
productVersion=2020.2 |
2 changes: 1 addition & 1 deletion
2
Extension/Xamarin.Forms.HotReload.Extension.Rider/gradle/wrapper/gradle-wrapper.properties
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
2 changes: 1 addition & 1 deletion
2
Extension/Xamarin.Forms.HotReload.Extension.Rider/src/dotnet/SdkVersion.props
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<SdkVersion>2019.3.0-*</SdkVersion> | ||
<SdkVersion>2020.1.0-*</SdkVersion> | ||
</PropertyGroup> | ||
</Project> |
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
48 changes: 0 additions & 48 deletions
48
...n.Rider/src/rider/main/kotlin/hotreload.extension.rider/component/SaveDocumentListener.kt
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
30 changes: 0 additions & 30 deletions
30
...ider/src/rider/main/kotlin/hotreload.extension.rider/component/StartUpProjectComponent.kt
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
...on.Rider/src/rider/main/kotlin/hotreload.extension.rider/services/SaveDocumentListener.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,34 @@ | ||
package hotreload.extension.rider.services | ||
|
||
import com.intellij.ide.actions.SaveAllAction | ||
import com.intellij.ide.actions.SaveDocumentAction | ||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.actionSystem.DataContext | ||
import com.intellij.openapi.actionSystem.ex.AnActionListener | ||
import com.intellij.openapi.project.Project | ||
import com.jetbrains.rd.util.reactive.hasTrueValue | ||
import com.jetbrains.rider.model.SavedDocument | ||
import com.jetbrains.rider.model.hotReloadPluginModel | ||
import com.jetbrains.rider.projectView.solution | ||
import com.jetbrains.rider.util.idea.PsiFile | ||
|
||
class SaveDocumentListener(val project: Project) : AnActionListener { | ||
|
||
override fun afterActionPerformed(action: AnAction, dataContext: DataContext, event: AnActionEvent) { | ||
super.afterActionPerformed(action, dataContext, event) | ||
|
||
if (action is SaveDocumentAction || action is SaveAllAction) { | ||
val psiFile = event.dataContext.PsiFile ?: return | ||
val filePath = psiFile.containingFile.viewProvider.virtualFile.canonicalPath | ||
val content = psiFile.containingFile.textToCharArray() | ||
|
||
val document = SavedDocument(filePath.toString(), content) | ||
val model = project.solution.hotReloadPluginModel | ||
if (model.isEnabled.hasTrueValue) { | ||
model.reload.fire(document) | ||
} | ||
} | ||
} | ||
} | ||
|
35 changes: 18 additions & 17 deletions
35
...sion/Xamarin.Forms.HotReload.Extension.Rider/src/rider/main/resources/META-INF/plugin.xml
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 |
---|---|---|
@@ -1,26 +1,27 @@ | ||
<idea-plugin> | ||
<id>hotreloadplugin-rider</id> | ||
<name>Hot Reload</name> | ||
<version>_PLACEHOLDER_</version> | ||
<vendor url="https://github.com/AndreiMisiukevich/HotReload">Ignat Bavtovich</vendor> | ||
<depends>com.intellij.modules.rider</depends> | ||
<id>hotreloadplugin-rider</id> | ||
<name>Hot Reload</name> | ||
<version>_PLACEHOLDER_</version> | ||
<vendor url="https://github.com/AndreiMisiukevich/HotReload">Ignat Bavtovich</vendor> | ||
<depends>com.intellij.modules.rider</depends> | ||
|
||
<description> | ||
Plugin helps to integrate Xamarin HotReload project with Rider and easily apply new changes in your code without | ||
any configuration | ||
</description> | ||
<description> | ||
Plugin helps to integrate Xamarin HotReload project with Rider and easily apply new changes in your code without | ||
any configuration | ||
</description> | ||
|
||
<application-components> | ||
<component> | ||
<implementation-class>hotreload.extension.rider.component.StartUpProjectComponent</implementation-class> | ||
</component> | ||
</application-components> | ||
<project-components> | ||
<component> | ||
<implementation-class>hotreload.extension.rider.component.SaveDocumentListener</implementation-class> | ||
</component> | ||
<component> | ||
<implementation-class>hotreload.extension.rider.component.ShowNotificationComponent</implementation-class> | ||
</component> | ||
</project-components> | ||
<actions> | ||
<action class="hotreload.extension.rider.action.RunPluginAction" icon="/logo/hotReloadOff.png"> | ||
<add-to-group group-id="NavBarToolBar" anchor="last"/> | ||
</action> | ||
</actions> | ||
<projectListeners> | ||
<listener class="hotreload.extension.rider.services.SaveDocumentListener" | ||
topic="com.intellij.openapi.actionSystem.ex.AnActionListener" /> | ||
</projectListeners> | ||
</idea-plugin> |