From dc7fd32b5d8841ea0bfedb1cf723bc8d4528cd62 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 21:36:15 +0000 Subject: [PATCH 1/4] Initial plan From bb9e6b142fd3ff3689f711e7551e65c50deccca4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 21:38:57 +0000 Subject: [PATCH 2/4] Fix test failure: Add [SetUp] attribute to Setup method Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com> --- test/Libraries/DynamoPythonTests/CodeCompletionTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs b/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs index f526e662a55..98aa2ba30b3 100644 --- a/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs +++ b/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs @@ -27,6 +27,7 @@ public void OneTimeSetup() [TestFixture] internal class SharedCodeCompletionProviderTests : UnitTestBase { + [SetUp] public override void Setup() { base.Setup(); From 3af80dbb7f37aaeb9b9f271434e48fe72c6e7330 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:04:29 +0000 Subject: [PATCH 3/4] Add diagnostic checks for assembly loading and null completion data Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com> --- test/Libraries/DynamoPythonTests/CodeCompletionTests.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs b/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs index 98aa2ba30b3..5704d9ea1de 100644 --- a/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs +++ b/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs @@ -34,6 +34,10 @@ public override void Setup() //for some legacy tests we'll need the DSPythonNet3 binary loaded manually //as the types are found using reflection - during normal dynamo use these types are already loaded. var path = Path.Combine(PathManager.BuiltinPackagesDirectory, @"PythonNet3Engine\extra\DSPythonNet3.dll"); + if (!File.Exists(path)) + { + Assert.Fail($"DSPythonNet3.dll not found at expected path: {path}. BuiltinPackagesDirectory: {PathManager.BuiltinPackagesDirectory}"); + } Assembly.LoadFrom(path); } @@ -52,6 +56,7 @@ public void SharedCoreCanReturnCLRCompletionData() var str = "\nimport System.Collections\nSystem.Collections."; var completionData = provider.GetCompletionData(str); + Assert.IsNotNull(completionData, "GetCompletionData returned null. This typically means the IExternalCodeCompletionProviderCore implementation could not be found. Ensure DSPythonNet3.dll is loaded."); var completionList = completionData.Select(d => d.Text); Assert.IsTrue(completionList.Any()); From 7e49d690ef88cee4afd3d25a3cdccd98d6e3564d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:07:37 +0000 Subject: [PATCH 4/4] Fix assembly loading by referencing type directly Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com> --- .../DynamoPythonTests/CodeCompletionTests.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs b/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs index 5704d9ea1de..8bd86e7b3a0 100644 --- a/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs +++ b/test/Libraries/DynamoPythonTests/CodeCompletionTests.cs @@ -32,13 +32,12 @@ public override void Setup() { base.Setup(); //for some legacy tests we'll need the DSPythonNet3 binary loaded manually - //as the types are found using reflection - during normal dynamo use these types are already loaded. - var path = Path.Combine(PathManager.BuiltinPackagesDirectory, @"PythonNet3Engine\extra\DSPythonNet3.dll"); - if (!File.Exists(path)) - { - Assert.Fail($"DSPythonNet3.dll not found at expected path: {path}. BuiltinPackagesDirectory: {PathManager.BuiltinPackagesDirectory}"); - } - Assembly.LoadFrom(path); + //as the types are found using reflection - during normal dynamo use these types are already loaded. + + // Force loading of the DSPythonNet3 assembly by accessing a type from it + // This ensures the assembly is in AppDomain.CurrentDomain.GetAssemblies() + // before SharedCompletionProvider tries to find IExternalCodeCompletionProviderCore implementations + var _ = typeof(DSPythonNet3CodeCompletionProviderCore); } [Test]