diff --git a/.idea/icon.png b/.idea/icon.png
new file mode 100644
index 0000000..73bb74f
Binary files /dev/null and b/.idea/icon.png differ
diff --git a/Directory.Build.props b/Directory.Build.props
index 16c38d5..8eed2a5 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -4,7 +4,7 @@
- 2026.1.5.2
+ 2026.3.0-eap07
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!
diff --git a/build.gradle.kts b/build.gradle.kts
index aea3e4f..5bbe18b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -166,6 +166,11 @@ dependencies {
bundledPlugin("com.intellij.resharper.unity")
bundledModule("intellij.spellchecker")
+
+ // Since 2026.3 these are separate product modules rather than part of the core classpath. rdclient.dotnet has
+ // RiderTypingPolicy/RiderEditorActionPolicy, SimpleOptionsPage and Project.solution; languages has the C# PSI.
+ bundledModule("intellij.rider.rdclient.dotnet")
+ bundledModule("intellij.rider.languages")
}
}
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/ReSharperPlugin.RimworldDev.Tests.csproj b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/ReSharperPlugin.RimworldDev.Tests.csproj
index a01143c..194c4b3 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/ReSharperPlugin.RimworldDev.Tests.csproj
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/ReSharperPlugin.RimworldDev.Tests.csproj
@@ -75,15 +75,16 @@
+ once anything makes it scan our plugin assembly. Use the netstandard2.0 builds: from 2026.3 the Rider.Backend
+ package also ships DotFiles/NetCore/netstandard2.0/JetBrains.Lifetimes.dll into the output, and the shell's
+ assembly binder refuses to start if the root copy is a different build (e.g. net472) with a different MVID. -->
<_JetPinnedLib Include="@(RuntimeCopyLocalItems)"
Condition="'%(RuntimeCopyLocalItems.Extension)' == '.dll' And ('%(RuntimeCopyLocalItems.NuGetPackageId)' == 'JetBrains.Lifetimes' Or '%(RuntimeCopyLocalItems.NuGetPackageId)' == 'JetBrains.RdFramework')" />
- <_JetNetFxLib Include="@(_JetPinnedLib->'%(RootDir)%(Directory)..\net472\%(Filename)%(Extension)')" />
+ <_JetNetFxLib Include="@(_JetPinnedLib->'%(RootDir)%(Directory)..\netstandard2.0\%(Filename)%(Extension)')" />
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestBooleanPropertyValue.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestBooleanPropertyValue.xml.gold
index 62a7967..a9156ac 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestBooleanPropertyValue.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestBooleanPropertyValue.xml.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 2
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
false <==
true
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefName.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefName.xml.gold
index 3bffd35..7107f2a 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefName.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefName.xml.gold
@@ -2,12 +2,13 @@
Prefix: "Thou"
Count: 1
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: " add_to_prefix
Range: "♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
OtherThing <==
TestThingB
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefReferenceSameFile.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefReferenceSameFile.xml.gold
index 03ebb55..ddb364b 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefReferenceSameFile.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefReferenceSameFile.xml.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 2
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
TestThingA <==
TestThingB
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefsFilterByType.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefsFilterByType.xml.gold
index 315b4b2..5ae17c8 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefsFilterByType.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestDefsFilterByType.xml.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 2
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
Metallic <==
Woody
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestEnumValue.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestEnumValue.xml.gold
index f4bb505..451c372 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestEnumValue.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestEnumValue.xml.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 12
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
Attachment 8 <==
Building 3
Ethereal 10
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestListItemProperties.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestListItemProperties.xml.gold
index 37ad97c..fd835eb 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestListItemProperties.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestListItemProperties.xml.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 1
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "<♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
compClass Type <==
##### ALPHABETIC SORT #####
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestListItemWithClassProperties.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestListItemWithClassProperties.xml.gold
index 6e59e3d..28aab8b 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestListItemWithClassProperties.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestListItemWithClassProperties.xml.gold
@@ -2,12 +2,13 @@
Prefix: "always"
Count: 1
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: " add_to_prefix
Range: "♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
CustomThing <==
TestThing
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestModDefClassProperties.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestModDefClassProperties.xml.gold
index 3a865f6..2d952f4 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestModDefClassProperties.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestModDefClassProperties.xml.gold
@@ -2,6 +2,7 @@
Prefix: "cus"
Count: 3
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: " add_to_prefix
Range: "<♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
compClass Type <==
customValue float
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestNestedFieldProperties.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestNestedFieldProperties.xml.gold
index ff4469c..623038e 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestNestedFieldProperties.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestNestedFieldProperties.xml.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 34
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "<♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
addTopAltitudeBias bool <==
allowAtlasing bool
allowFlip bool
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestParentName.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestParentName.xml.gold
index f44d911..a494707 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestParentName.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestParentName.xml.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 1
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: ""
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
AbstractBase <==
##### ALPHABETIC SORT #####
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestStructPropertyValue.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestStructPropertyValue.xml.gold
index 96458cb..83b25b4 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestStructPropertyValue.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestStructPropertyValue.xml.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 5
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "♦"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NormalSelectionPriority, Other]
East Rot4 <==
Invalid Rot4
North Rot4
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestThingDefProperties.xml.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestThingDefProperties.xml.gold
index f0d90ab..a91f5c6 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestThingDefProperties.xml.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/Rimworld/TestThingDefProperties.xml.gold
@@ -2,6 +2,7 @@
Prefix: "altit"
Count: 2
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "
##### ALPHABETIC SORT #####
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefDatabaseGetNamed.cs.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefDatabaseGetNamed.cs.gold
index 9cec850..612bf53 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefDatabaseGetNamed.cs.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefDatabaseGetNamed.cs.gold
@@ -1,11 +1,12 @@
Completion: Basic
Count: 2
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "public static ThingDef Get() => DefDatabase.GetNamed("♦");"
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, NotObsolete, ObsoleteRuleApplied, NormalSelectionPriority, Other]
+ [FromLightEvaluation, NotObsolete, ObsoleteRuleApplied, NormalSelectionPriority, Other]
ModThingA <==
ModThingB
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefOfFieldWithPrefix.cs.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefOfFieldWithPrefix.cs.gold
index f9f38c5..38f80d4 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefOfFieldWithPrefix.cs.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefOfFieldWithPrefix.cs.gold
@@ -2,12 +2,13 @@
Prefix: "Mod"
Count: 4
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "public static ThingDef Mod♦"
▲▲▲▲
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, PrefixMatch, NotObsolete, ObsoleteRuleApplied, NormalSelectionPriority, Other]
+ [FromLightEvaluation, PrefixMatch, NotObsolete, ObsoleteRuleApplied, NormalSelectionPriority, Other]
ṂọḍDef <==
ṂọḍThingA
ṂọḍThingB
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefOfFieldWithPrefixAndSemicolon.cs.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefOfFieldWithPrefixAndSemicolon.cs.gold
index 7aacee7..664e17f 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefOfFieldWithPrefixAndSemicolon.cs.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/CompletionSuggestions/RimworldCSharp/TestDefOfFieldWithPrefixAndSemicolon.cs.gold
@@ -2,12 +2,13 @@
Prefix: "Mod"
Count: 4
Focus: Hard
+Rules: [\w] => add_to_prefix
Range: "public static ThingDef Mod♦;"
▲▲▲▲
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, PrefixMatch, NotObsolete, ObsoleteRuleApplied, NormalSelectionPriority, Other]
+ [FromLightEvaluation, PrefixMatch, NotObsolete, ObsoleteRuleApplied, NormalSelectionPriority, Other]
ṂọḍDef <==
ṂọḍThingA
ṂọḍThingB
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/NuGetLocks/558c33f34eb797d526beac5c21e7ced04cacc4975c989ccb4c610ba0395f0e1b.lock b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/NuGetLocks/558c33f34eb797d526beac5c21e7ced04cacc4975c989ccb4c610ba0395f0e1b.lock
new file mode 100644
index 0000000..caa6e87
--- /dev/null
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/NuGetLocks/558c33f34eb797d526beac5c21e7ced04cacc4975c989ccb4c610ba0395f0e1b.lock
@@ -0,0 +1,4 @@
+# Please commit this file, it's crucial for tests stability. Even if you believe it's not yours, it still needs to be committed.
+# Input (NuGetFramework=net35):
+# JetBrains.Annotations [2026.2.0]
+JetBrains.Annotations 2026.2.0
\ No newline at end of file
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/SmokeTests/CSharp/TestLocalVariable.cs.gold b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/SmokeTests/CSharp/TestLocalVariable.cs.gold
index fe33494..b97934b 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/SmokeTests/CSharp/TestLocalVariable.cs.gold
+++ b/src/dotnet/ReSharperPlugin.RimworldDev.Tests/test/data/SmokeTests/CSharp/TestLocalVariable.cs.gold
@@ -2,12 +2,15 @@
Prefix: "myLoc"
Count: 1
Focus: Hard
+Rules: [ =] & prefix="_" => hide_lookup
+ ["$] & prefix="@" => hide_lookup
+ [\w] => add_to_prefix
Range: "myLoc♦"
▲▲▲▲▲▲
##### RELEVANCE SORT #####
- [FromSingleCompletion, FromLightAndDynamicEvaluation, PrefixMatch, LocalVariablesAndParameters, NotObsolete, ObsoleteRuleApplied, NormalSelectionPriority, ClosestLocalVar, Other]
+ [FromLightEvaluation, PrefixMatch, LocalVariablesAndParameters, NotObsolete, ObsoleteRuleApplied, NormalSelectionPriority, ClosestLocalVar, Other]
ṃỵḶọc̣alVariable int <==
##### ALPHABETIC SORT #####
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev/RimworlXMLCompletionContextProvider.cs b/src/dotnet/ReSharperPlugin.RimworldDev/RimworlXMLCompletionContextProvider.cs
index 56e69cc..1888997 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev/RimworlXMLCompletionContextProvider.cs
+++ b/src/dotnet/ReSharperPlugin.RimworldDev/RimworlXMLCompletionContextProvider.cs
@@ -72,7 +72,7 @@ public override ISpecificCodeCompletionContext GetCompletionContext(CodeCompleti
TextLookupRanges textLookupRanges = CodeCompletionContextProviderBase.GetTextLookupRanges(context, documentRange);
return new RimworldXmlCodeCompletionContext(context, xmlFile,
- xmlFile.FindNodeAt(unterminatedContext.Range), textLookupRanges);
+ xmlFile.FindNodeAt(context.SelectedTreeRange), textLookupRanges);
}
}
}
\ No newline at end of file
diff --git a/src/dotnet/ReSharperPlugin.RimworldDev/RimworldCSharpLookupFactory.cs b/src/dotnet/ReSharperPlugin.RimworldDev/RimworldCSharpLookupFactory.cs
index 6c412af..5a341ec 100644
--- a/src/dotnet/ReSharperPlugin.RimworldDev/RimworldCSharpLookupFactory.cs
+++ b/src/dotnet/ReSharperPlugin.RimworldDev/RimworldCSharpLookupFactory.cs
@@ -7,8 +7,8 @@
using JetBrains.ReSharper.Feature.Services.CodeCompletion.Infrastructure;
using JetBrains.ReSharper.Feature.Services.CodeCompletion.Infrastructure.AspectLookupItems.BaseInfrastructure;
using JetBrains.ReSharper.Feature.Services.CodeCompletion.Infrastructure.AspectLookupItems.Info;
-using JetBrains.ReSharper.Feature.Services.CodeCompletion.Infrastructure.AspectLookupItems.Matchers;
using JetBrains.ReSharper.Feature.Services.CodeCompletion.Infrastructure.AspectLookupItems.Presentations;
+using JetBrains.ReSharper.Feature.Services.CodeCompletion.Infrastructure.Match;
using JetBrains.ReSharper.Feature.Services.CSharp.CodeCompletion.Infrastructure;
using JetBrains.ReSharper.Features.Intellisense.CodeCompletion.CSharp;
using JetBrains.ReSharper.Features.Intellisense.CodeCompletion.CSharp.AspectLookupItems;
@@ -27,9 +27,8 @@
namespace ReSharperPlugin.RimworldDev;
-// Note, this class is mostly copy-pasted from Jetbrains CSharpLookupFactory class, I just made some minor additions
-// so that the autocomplete would display a bit nicer
-
+// Note, this class is mostly copy-pasted from Jetbrains' CSharpLookupItemFactory (SDK 2021.2), I just made some minor
+// additions so that the autocomplete would display a bit nicer
public class RimworldCSharpLookupFactory
{
private readonly Func, ILookupItemPresentation>
@@ -63,9 +62,6 @@ private readonly Func, ILookupItemPresenta
private readonly Func, ILookupItemBehavior> myFGetDeclaredElementBehavior =
item => new CSharpDeclaredElementBehavior(item);
- private readonly Func, ILookupItemMatcher> myFGetDeclaredElementMatcher =
- item => new DeclaredElementMatcher(item.Info, "@");
-
private readonly Func, ILookupItemBehavior> myFGetTypeElementBehavior =
item => new CSharpDeclaredElementBehavior(item);
@@ -211,7 +207,7 @@ public LookupItem CreateDeclaredElementLookupItem(
var dataHolder = LookupItemFactory.CreateLookupItem(declaredElementInfo)
.WithPresentation(fGetPresentation)
.WithBehavior(myFGetDeclaredElementBehavior)
- .WithMatcher(myFGetDeclaredElementMatcher);
+ .WithMatcher(LookupItemMatcher.CSharpIdentifier);
var typeOwner = element as ITypeOwner;
if (instance.Element is IAnonymousTypeProperty)
diff --git a/src/rider/main/kotlin/run/RunConfiguration.kt b/src/rider/main/kotlin/run/RunConfiguration.kt
index 049a355..1c6ab86 100644
--- a/src/rider/main/kotlin/run/RunConfiguration.kt
+++ b/src/rider/main/kotlin/run/RunConfiguration.kt
@@ -107,7 +107,6 @@ class RunConfiguration(project: Project, factory: ConfigurationFactory, name: St
getSaveFilePath(),
getModListPath(),
getRimworldState(environment),
- UnityDebugRemoteConfiguration(),
environment,
"CustomPlayer"
);
diff --git a/src/rider/main/kotlin/run/RunState.kt b/src/rider/main/kotlin/run/RunState.kt
index 72ed7bf..b682277 100644
--- a/src/rider/main/kotlin/run/RunState.kt
+++ b/src/rider/main/kotlin/run/RunState.kt
@@ -2,16 +2,15 @@ package RimworldDev.Rider.run
import RimworldDev.Rider.helpers.ScopeHelper
import com.intellij.execution.ExecutionResult
-import com.intellij.execution.Executor
import com.intellij.execution.configurations.RunProfileState
import com.intellij.execution.process.*
import com.intellij.execution.runners.ExecutionEnvironment
-import com.intellij.execution.runners.ProgramRunner
+import com.intellij.execution.ui.ConsoleView
import com.intellij.util.system.OS
import com.jetbrains.rd.util.lifetime.Lifetime
import com.jetbrains.rider.debugger.DebuggerWorkerProcessHandler
+import com.jetbrains.rider.plugins.unity.run.UnityDebugEngine
import com.jetbrains.rider.plugins.unity.run.configurations.UnityAttachProfileState
-import com.jetbrains.rider.run.configurations.remote.RemoteConfiguration
import com.jetbrains.rider.run.getProcess
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@@ -25,11 +24,13 @@ class RunState(
private val saveFilePath: String,
private val modListPath: String,
private val rimworldState: RunProfileState,
- remoteConfiguration: RemoteConfiguration,
executionEnvironment: ExecutionEnvironment,
targetName: String
) :
- UnityAttachProfileState(remoteConfiguration, executionEnvironment, targetName), RunProfileState {
+ UnityAttachProfileState(executionEnvironment, targetName, false), RunProfileState {
+ // Doorstop's debugger agent listens on localhost:56000; we connect to it rather than waiting for the game to dial in
+ override fun getDebugEngine(): UnityDebugEngine = UnityDebugEngine.Mono("localhost", 56000, false)
+
private val resources = mapOf(
OS.Windows to listOf(
".doorstop_version",
@@ -77,8 +78,7 @@ class RunState(
)
override suspend fun execute(
- executor: Executor,
- runner: ProgramRunner<*>,
+ workerConsole: ConsoleView,
workerProcessHandler: DebuggerWorkerProcessHandler,
lifetime: Lifetime
): ExecutionResult {
@@ -104,10 +104,10 @@ class RunState(
}
} else {
// Windows: rimworldState handles env vars and process lifecycle normally.
- rimworldState.execute(executor, runner)?.processHandler?.getProcess()
+ rimworldState.execute(executionEnvironment.executor, executionEnvironment.runner)?.processHandler?.getProcess()
}
- val result = super.execute(executor, runner, workerProcessHandler)
+ val result = super.execute(workerConsole, workerProcessHandler, lifetime)
ProcessTerminatedListener.attach(workerProcessHandler.debuggerWorkerRealHandler)
workerProcessHandler.debuggerWorkerRealHandler.addProcessListener(object : ProcessAdapter() {
override fun processTerminated(event: ProcessEvent) {
diff --git a/src/rider/main/kotlin/run/UnityDebugRemoteConfiguration.kt b/src/rider/main/kotlin/run/UnityDebugRemoteConfiguration.kt
deleted file mode 100644
index 28aa5b3..0000000
--- a/src/rider/main/kotlin/run/UnityDebugRemoteConfiguration.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-package RimworldDev.Rider.run
-
-import com.jetbrains.rider.run.configurations.remote.RemoteConfiguration
-
-class UnityDebugRemoteConfiguration: RemoteConfiguration {
- override var address: String
- get() = "localhost"
- set(value) {}
- override var listenPortForConnections: Boolean
- get() = false
- set(value) {}
- override var port: Int
- get() = 56000
- set(value) {}
-}
\ No newline at end of file