diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c16194a..14ae2bc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,6 +10,7 @@ jobs: Build: runs-on: ubuntu-latest steps: + - uses: jlumbroso/free-disk-space@main - uses: actions/checkout@v4 with: submodules: recursive @@ -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 @@ -29,6 +34,7 @@ jobs: Test: runs-on: ubuntu-latest steps: + - uses: jlumbroso/free-disk-space@main - uses: actions/checkout@v4 with: submodules: recursive @@ -36,6 +42,10 @@ jobs: 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 \ No newline at end of file diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml index 1d79630..ca49c61 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Deploy.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest environment: Deploy steps: + - uses: jlumbroso/free-disk-space@main - uses: actions/checkout@v4 with: submodules: recursive @@ -17,7 +18,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'corretto' - java-version: '17' + java-version: '21' cache: 'gradle' - name: Setup .NET uses: actions/setup-dotnet@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5397358..d2c1ab3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Directory.Build.props b/Directory.Build.props index 066f197..8ba4335 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 2025.1.0 + 2025.3.* Rimworld Development Environment 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! @@ -36,7 +36,7 @@ - + diff --git a/build.gradle.kts b/build.gradle.kts index a57877b..383959a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -167,10 +167,7 @@ dependencies { jetbrainsRuntime() bundledPlugin("com.intellij.resharper.unity") - - if (ProductVersion.contains("2025.2")) { - bundledModule("intellij.spellchecker") - } + bundledModule("intellij.spellchecker") } } diff --git a/gradle.properties b/gradle.properties index 71664e2..3fe06ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 @@ -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 diff --git a/src/dotnet/ReSharperPlugin.RimworldDev/TemplateParameters/RimworldDLLParameter.cs b/src/dotnet/ReSharperPlugin.RimworldDev/TemplateParameters/RimworldDLLParameter.cs index 8595df3..5c0968f 100644 --- a/src/dotnet/ReSharperPlugin.RimworldDev/TemplateParameters/RimworldDLLParameter.cs +++ b/src/dotnet/ReSharperPlugin.RimworldDev/TemplateParameters/RimworldDLLParameter.cs @@ -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, ""); } } diff --git a/src/rider/main/kotlin/XmlTypingPolicy.kt b/src/rider/main/kotlin/XmlTypingPolicy.kt new file mode 100644 index 0000000..667c441 --- /dev/null +++ b/src/rider/main/kotlin/XmlTypingPolicy.kt @@ -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 + } +} \ No newline at end of file diff --git a/src/rider/main/kotlin/remodder/RemodderToolWindowFactory.kt b/src/rider/main/kotlin/remodder/RemodderToolWindowFactory.kt index 86b2a32..3d93b69 100644 --- a/src/rider/main/kotlin/remodder/RemodderToolWindowFactory.kt +++ b/src/rider/main/kotlin/remodder/RemodderToolWindowFactory.kt @@ -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 @@ -52,36 +53,39 @@ class RemodderToolWindowFactory : ToolWindowFactory { refresh.addActionListener { val userAssemblies = project.getService(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) ?: "" + val filePath = virtualFile.path + val typeName = namespaceAndClassOfElement(el) ?: "" - 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 + } } } diff --git a/src/rider/main/kotlin/run/RunConfiguration.kt b/src/rider/main/kotlin/run/RunConfiguration.kt index 33e5eac..6cfe968 100644 --- a/src/rider/main/kotlin/run/RunConfiguration.kt +++ b/src/rider/main/kotlin/run/RunConfiguration.kt @@ -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() }) diff --git a/src/rider/main/resources/META-INF/plugin.xml b/src/rider/main/resources/META-INF/plugin.xml index 7c4eca1..b88c914 100644 --- a/src/rider/main/resources/META-INF/plugin.xml +++ b/src/rider/main/resources/META-INF/plugin.xml @@ -3,7 +3,7 @@ Rimworld Development Environment 0.0.0 Garethp - + com.intellij.modules.rider com.intellij.resharper.unity @@ -30,6 +30,9 @@ in your mods!

+ + +