feat(scripteditor): tag-path completion for absolute RawPaths #490
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Deferred from v3 Batch 3, re-recorded in the Batch 4 PR doc.
Monaco tag-path completion inside
ctx.GetTag("…")/ctx.SetVirtualTag("…")works for the equipment-relative{{equip}}/form, but not for absolute RawPaths (Plant/Modbus/dev1/Speed).Since v3 the raw tree is the authoring surface for device I/O and absolute RawPaths are a normal thing to write in a script, so the completion gap pushes authors to type them by hand — and a typo'd RawPath is only caught at deploy (
Bad 0x80000000at runtime for the literal).Worth pairing with the existing tag-path hover so an absolute path resolves and displays like a relative one. Editor-accepts ⇔ publish-accepts is the invariant to preserve.
Fixed in
123ddc3f, live-gated.It was not a missing feature — it was a stale projection, and the consequence was worse than the gap reported.
ScriptTagCatalogstill emittedTag.TagConfig.FullName, the pre-v3 driver wire address. Since v3 the resolvable key is the RawPath:AddressSpaceComposerharvests thectx.GetTag("…")literals intoDependencyRefs->VirtualTagActordependency refs ->DependencyMuxActor._byRef, keyed Ordinal byAttributeValuePublished.FullReference— and a driver's wire ref is the RawPath (DriverHostActor._nodeIdByDriverRefis keyed(DriverInstanceId, RawPath)). The{{equip}}/<RefName>form already substitutes to RawPaths at both compose seams, which is why the relative form worked and the absolute one did not.So the catalog was wrong in both directions:
Motor.Speed— a path that can never resolve at runtimePlant/Modbus/dev1/SpeedThe file's own comment admitted the raw/UNS catalog was left for "Batch 2/3"; it never came.
Now projected through the shared
RawPathResolver— the same byte-parity authorityDraftValidatorandAddressSpaceComposeruse — so a suggestion is byte-identical to what the deploy gate and the runtime compute. A tag whose ancestry chain is broken resolves to null and is omitted: the runtime could not route it either, so offering it would be a lie.The editor-accepts ⇔ publish-accepts invariant is preserved. No diagnostic keys off this catalog —
OTSCRIPT_EQUIPREFonly marks{{equip}}paths — so this changes completion and hover only and cannot newly reject a script.The existing tests pinned the v2 contract, so they were re-authored (a RawPath only exists if the
RawFolder -> DriverInstance -> Device -> TagGroup -> Tagchain does). Added coverage: group-nested paths, a driver at the cluster root contributing no folder segment, a broken chain omitted rather than guessed, and the pre-v3 FullName no longer resolving.Live gate (docker-dev, rig rebuilt, both central nodes):
opcua1/plc/OpcPlc/Telemetry/Basic/AlternatingBooleanpymod->pymodbus/plc/HR200X,pymodbus/plc/ImportedTagpymodbus/plc/HR200X-> "Tag · Type UInt16 · Driver MAIN-modbus" (the driver is new — it was always null before)AdminUI 742/742, script-analysis 55/55, solution builds 0 errors.