Skip to content
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
12 changes: 11 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: jlumbroso/free-disk-space@main
- uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -19,6 +20,10 @@ jobs:
distribution: 'corretto'
java-version: '21'
cache: 'gradle'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- run: ./gradlew :buildPlugin --no-daemon
- run: ./gradlew :buildResharperPlugin --no-daemon
- uses: actions/upload-artifact@v4
Expand All @@ -29,13 +34,18 @@ jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: jlumbroso/free-disk-space@main
- uses: actions/checkout@v4
with:
submodules: recursive
- name: configure_java
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
java-version: '21'
cache: 'gradle'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- run: ./gradlew :testDotNet --no-daemon
3 changes: 2 additions & 1 deletion .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ jobs:
runs-on: ubuntu-latest
environment: Deploy
steps:
- uses: jlumbroso/free-disk-space@main
- uses: actions/checkout@v4
with:
submodules: recursive
- name: configure_java
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
java-version: '21'
cache: 'gradle'
- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2025.1.5
* Fix the issue with XML tags getting messed up in Rider

## 2025.1.4
* Fixed Autocomplete in XML

Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<SdkVersion>2025.1.0</SdkVersion>
<SdkVersion>2025.3.*</SdkVersion>

<Title>Rimworld Development Environment</Title>
<Description>Bring the intelligence of your IDE to Rimworld XML files. Use information backed by Rimworlds DLL file to autocomplete your XML, Ctrl+Click into the C# that your XML gets translated into and see what options you have when adding items in your mods!</Description>
Expand Down Expand Up @@ -36,7 +36,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4" />
<PackageReference Include="JetBrains.Lifetimes" Version="$(SdkVersion)" />
<PackageReference Include="JetBrains.RdFramework" Version="$(SdkVersion)" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
Expand Down
5 changes: 1 addition & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ dependencies {
jetbrainsRuntime()

bundledPlugin("com.intellij.resharper.unity")

if (ProductVersion.contains("2025.2")) {
bundledModule("intellij.spellchecker")
}
bundledModule("intellij.spellchecker")
}
}

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
DotnetPluginId=ReSharperPlugin.RimworldDev
DotnetSolution=ReSharperPlugin.RimworldDev.sln
RiderPluginId=com.jetbrains.rider.plugins.rimworlddev
PluginVersion=2025.1.4
PluginVersion=2025.1.5

BuildConfiguration=Release

Expand All @@ -14,14 +14,14 @@ PublishToken="_PLACEHOLDER_"
# Release: 2020.2
# Nightly: 2020.3-SNAPSHOT
# EAP: 2020.3-EAP2-SNAPSHOT
ProductVersion=2025.1
ProductVersion=2025.3

# Kotlin 1.4 will bundle the stdlib dependency by default, causing problems with the version bundled with the IDE
# https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-rc-released/#stdlib-default
kotlin.stdlib.default.dependency=false
org.gradle.jvmargs=-Xmx4g

rdVersion=2025.1
rdVersion=2025.3
rdKotlinVersion=2.1.0
intellijPlatformGradlePluginVersion=2.2.1
gradleJvmWrapperVersion=0.14.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public override RdProjectTemplateOption CreateContent(ITemplateInfo templateInfo
{
var detectedPath = ScopeHelper.FindRimworldDll(Directory.GetCurrentDirectory())?.FullPath;

return new RdProjectTemplateTextOption(detectedPath ?? "", "string", Name, PresentableName, Tooltip);
return new RdProjectTemplateTextOption(detectedPath ?? "", "string", Name, PresentableName, Tooltip, "");
}
}

Expand Down
16 changes: 16 additions & 0 deletions src/rider/main/kotlin/XmlTypingPolicy.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package RimworldDev.Rider

import com.jetbrains.rider.editorActions.RiderEditorActionPolicy
import com.jetbrains.rider.editorActions.RiderTypingPolicy

class XmlTypingPolicy : RiderTypingPolicy {
override fun forceFrontendExecution(): Boolean {
return true
}
}

class XmlEditorActionPolicy : RiderEditorActionPolicy {
override fun forceFrontendExecution(): Boolean {
return true
}
}
52 changes: 28 additions & 24 deletions src/rider/main/kotlin/remodder/RemodderToolWindowFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.intellij.openapi.fileEditor.TextEditor
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.DialogBuilder
import com.intellij.openapi.ui.Messages
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.psi.PsiElement
Expand Down Expand Up @@ -52,36 +53,39 @@ class RemodderToolWindowFactory : ToolWindowFactory {
refresh.addActionListener {
val userAssemblies = project.getService<RemodderStateComponent>(RemodderStateComponent::class.java).state.userAssemblies
val editor = (FileEditorManager.getInstance(project).selectedEditor as TextEditor).editor
val view = PsiManager.getInstance(project).findViewProvider(editor.virtualFile)
val el = view?.findElementAt(editor.caretModel.offset) ?: return@addActionListener
var virtualFile: VirtualFile? = editor.virtualFile
if (virtualFile != null) {
val view = PsiManager.getInstance(project).findViewProvider(virtualFile)
val el = view?.findElementAt(editor.caretModel.offset) ?: return@addActionListener

val filePath = editor.virtualFile.path
val typeName = namespaceAndClassOfElement(el) ?: "<null>"
val filePath = virtualFile.path
val typeName = namespaceAndClassOfElement(el) ?: "<null>"

statusLabel.text = "$typeName..."
errorDetails.isVisible = false
statusLabel.text = "$typeName..."
errorDetails.isVisible = false

project.solution.remodderProtocolModel.decompile.start(arrayOf(filePath, typeName) + userAssemblies).toPromise().then {
if (it.size == 1)
{
statusLabel.text = "$typeName: ${it[0]}"
errorDetails.isVisible = false
return@then
}
project.solution.remodderProtocolModel.decompile.start(arrayOf(filePath, typeName) + userAssemblies)
.toPromise().then {
if (it.size == 1) {
statusLabel.text = "$typeName: ${it[0]}"
errorDetails.isVisible = false
return@then
}

val content1 = DiffContentFactory.getInstance().create(project, it[0], editor.virtualFile)
val content2 = DiffContentFactory.getInstance().create(project, it[1], editor.virtualFile)
content2.putUserData(DiffUserDataKeys.FORCE_READ_ONLY, true)
val content1 = DiffContentFactory.getInstance().create(project, it[0], virtualFile)
val content2 = DiffContentFactory.getInstance().create(project, it[1], virtualFile)
content2.putUserData(DiffUserDataKeys.FORCE_READ_ONLY, true)

val request = SimpleDiffRequest("Original/Transpiled", content1, content2, "Original", "Transpiled")
diffPanel.setRequest(request)
val request = SimpleDiffRequest("Original/Transpiled", content1, content2, "Original", "Transpiled")
diffPanel.setRequest(request)

statusLabel.text = typeName
errorDetails.isVisible = false
}.onError {
errorMsg = it.toString()
statusLabel.text = "$typeName: ERROR"
errorDetails.isVisible = true
statusLabel.text = typeName
errorDetails.isVisible = false
}.onError {
errorMsg = it.toString()
statusLabel.text = "$typeName: ERROR"
errorDetails.isVisible = true
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/rider/main/kotlin/run/RunConfiguration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ class RunConfiguration(project: Project, factory: ConfigurationFactory, name: St
pathToRun = "/bin/sh"
}

if (OS.CURRENT == OS.macOS) {
arguments = "$pathToRun $arguments"
pathToRun = "open"
}

val commandLine = GeneralCommandLine(pathToRun)
.withParameters(arguments.split(' ').filter { it.isNotEmpty() })

Expand Down
5 changes: 4 additions & 1 deletion src/rider/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>Rimworld Development Environment</name>
<version>0.0.0</version>
<vendor url="https://github.com/Garethp/Rider-RimworldDevelopment">Garethp</vendor>
<idea-version since-build="251" />
<idea-version since-build="253" />
<depends>com.intellij.modules.rider</depends>
<depends>com.intellij.resharper.unity</depends>

Expand All @@ -30,6 +30,9 @@ in your mods!</p>

<spellchecker.bundledDictionaryProvider implementation="RimworldDev.Rider.spellchecker.DictionaryProvider" />
<toolWindow factoryClass="RimworldDev.Rider.remodder.RemodderToolWindowFactory" id="Remodder"/>

<editor.action.execution.policy language="XML" implementationClass="RimworldDev.Rider.XmlEditorActionPolicy" />
<typing.policy language="XML" implementationClass="RimworldDev.Rider.XmlTypingPolicy" />
</extensions>

</idea-plugin>
Loading