From f5a392c684cc0af922371152bc5fea785b4f7834 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 22 Oct 2026 15:15:41 -0400 Subject: [PATCH] docs(scripting): note that dot-completion walks the base chain for every receiver Review m-5. The ctx.CancellationToken completion fix (d2cc0715) made TryGetDotMembers include inherited instance members for EVERY receiver, not only ctx. The visible side effect beyond the item's scope: struct and enum receivers now also complete the System.ValueType / System.Enum instance members they inherit (CompareTo, HasFlag, ...). These are valid, compilable members, so the change is kept. This commit records it here and in the code comment. Refs #731 #734 Claude-Session: https://claude.ai/code/session_01Ub9hGmYLQvn9XETzw7CMsT --- .../ScriptAnalysis/ScriptAnalysisService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/ScriptAnalysis/ScriptAnalysisService.cs b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/ScriptAnalysis/ScriptAnalysisService.cs index 9df80b09..23d610b7 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/ScriptAnalysis/ScriptAnalysisService.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/ScriptAnalysis/ScriptAnalysisService.cs @@ -271,7 +271,9 @@ public sealed class ScriptAnalysisService // The type's own members, then the INSTANCE members it inherits (stopping before System.Object, whose // ToString/GetHashCode noise was never offered). Without the base chain, a member declared only on // ScriptContext — ctx.CancellationToken — compiled and published but never completed. Inherited statics - // (ScriptContext.Deadband) are left out: they are not reachable through an instance receiver. + // (ScriptContext.Deadband) are left out: they are not reachable through an instance receiver. This applies to + // EVERY receiver, not only ctx: a struct or enum receiver now also offers the System.ValueType / + // System.Enum instance members it inherits (CompareTo, HasFlag, ...), all of which compile. var inherited = new List(); for (var b = type.BaseType; b is not null && b.SpecialType != SpecialType.System_Object; b = b.BaseType) inherited.AddRange(b.GetMembers().Where(m => !m.IsStatic));