Repository navigation
feat(LC0091): report translatable properties set in modify blocks - #691
Merged
Merged
Conversation
Fixtures for the translatable properties set in modify(...) blocks, which LC0091 does not report yet: page extension field, group, part, action, action group, view and analysis view changes; page customization field, group, part, action, action group and view changes, plus the view a customization adds; table extension field changes; report extension request page field changes; and the field changes inside a page view's layout, on the page and in a view a page extension adds. Each comes as empty XLIFF, Locked = true, and translated against trans-unit IDs generated by the AL compiler. Also a table extension modify on a Removed table and on a Pending field, whose units the compiler still writes, a namespaced page extension field Caption, and a page extension that adds one view and modifies another. The exact-count test now asserts one diagnostic per marker so it covers fixtures with more than one marker. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A modify(...) block is a Change symbol that raises its own symbol event and carries the properties the block sets; the compiler writes them as "<Root> - Change <target> - Property <name>" trans-units. LC0091 now registers SymbolKind.Change and checks it like every other symbol kind that carries its own properties. The Change that wraps a member an extension adds and a move change carry no properties, so they report nothing and the added member is still reported once. This covers page extension, page customization, table extension and report extension request page modify blocks, and the control changes inside a page view's layout. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Records why Change is registered without a filter (modify blocks carry the properties they set; add wrappers, moves and table extension field group adds carry none), that page customizations now reach their modify blocks and added views, that modify blocks never lock on the target's obsolete state, the new deliberate non-reports (report extension request page action changes, AL0246 and AL0433 rejections), the SDK facts behind them, and the trans-unit ID shape of modify blocks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 26, 2026
…sized changes The promoted-group change a page extension or page customization synthesizes from PromotedActionCategories carries a synthesized Caption without a syntax reference, which the locked check skips; the count test now proves that neither extension kind reports it twice, and the rule doc states the mechanism instead of the actionref-only wording. Co-Authored-By: Claude Fable 5.1 <[email protected]>
25 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #690
Closes #668
Summary
Properties set in a
modify(...)block were unchecked: the compiler writes them as<Root> - Change <target> - Property <name>trans-units, butSymbolKind.Changewas not registered.EnumProvider.SymbolKind.Changeis added to theRegisterSymbolActionlist and flows through the defaultReportTranslatablePropertiesbranch. That is the whole analyzer change (one registration plus the comment above the default branch). No filter, no special case.IsLockedByCompiler,IsPropertyLockedand theNETSTANDARD2_1stub are unchanged.SourceChangeAddSymbol), move changes and a table extension's field groupaddlastcarry no properties, soGetPropertyfinds nothing on them and nothing is reported twice (proven by the count test below).SDK evidence (
nav-sdk-source, net10.0;SourceChangeModifySymbol.csidentical in net8.0):Symbols/SourceChangeModifySymbol.cs:139callsNotifyCompilationAboutSymbolCompletion, so every modify block raises a symbol event;Nameis the target name (:31),Propertiesare the block's properties (:54). Subclasses: control, action, view, analysis view, field, report dataset, plusSynthesizedSourceChangeModifyActionSymbol(actionref changes, which carry only a synthesizedVisible).Symbols/ChangeSymbol.cs:17:Kind => SymbolKind.Change.Symbols/Symbol.cs:168:Propertiesis empty by default; neitherSourceChangeAddSymbolnor theSourceChangeMove*Symbolclasses override it.Translation/LabelWriterVisitor.cs:DefaultVisit(:51) writes a Change's properties like any symbol's.ShouldVisitMember(:328) skips only the members of a move change or of a change inside a view, never the change's own properties.IsObsolete(:285) readsIsObsoleteRemoved, which no change symbol overrides (the 7 overrides are field, key, page reference, record, synthesized key, table extension, table), so a modify block is never locked by its target's obsolete state.Symbols/RequestPageExtensionObjectMembers.cs:53:BuildDeclaredMembersCorebuilds members fromDeclaration.Layoutonly.Tests
Fixture triples (empty-XLIFF
HasDiagnostic,Locked<…>andTranslated<…>NoDiagnostic), 50 items, 150 files:PageExtensionModifyField{Caption,ToolTip,OptionCaption,InstructionalText,AboutTitle,AboutText},PageExtensionModifyGroup{Caption,InstructionalText,AboutTitle,AboutText},PageExtensionModifyPart{Caption,ToolTip,AboutTitle,AboutText},PageExtensionModifyAction{Caption,ToolTip,AboutTitle,AboutText},PageExtensionModifyActionGroup{Caption,ToolTip,AboutTitle,AboutText},PageExtensionModifyViewCaption,PageExtensionModifyAnalysisViewCaption(gated18.0.36, net10.0 SDK, like the existing analysis-view cases)PageCustomizationModify{Field,Group,Part,Action}{AboutTitle,AboutText},PageCustomizationModifyActionGroup{Caption,AboutTitle,AboutText},PageCustomizationModifyViewCaption,PageCustomizationViewCaption(added view; passed before the change, proving theViewregistration already covers it)TableExtensionModifyField{Caption,ToolTip,OptionCaption}ReportExtensionModifyRequestPageField{Caption,ToolTip,OptionCaption,InstructionalText,AboutTitle,AboutText}layout:PageViewModifyField{AboutTitle,AboutText},PageExtensionViewModifyField{AboutTitle,AboutText}(view added by a page extension)Plus
HasDiagnostic/TableExtensionModifyFieldCaptionInObsoleteRemovedTable,HasDiagnostic/TableExtensionModifyObsoletePendingFieldCaption,HasDiagnostic/PageExtensionAddAndModifyViewCaption, and the namespaced pairNamespacePageExtensionModifyFieldCaption/NamespacePageExtensionModifyFieldCaptionTranslated(RequireMinimumVersion("18.0.38.52553", …)).New XLIFF constants
TranslatedModifyChangePropertiesXliffContent(50 units, helperCreateFixtureWithTranslatedModifyChangePropertiesXliff, which also carriesMyAnalysisView.analysis.json; methodNoDiagnosticTranslatedModifyChangeProperties) andNamespaceTranslatedPageExtensionModifyFieldCaptionXliffContent(methodNoDiagnosticTranslatedModifyChangePropertiesWithNamespaces).Trans-unit IDs were not computed by hand: each fixture (markers stripped, plus a
Lockedvariant) was compiled as its own scratch app ("features": ["TranslationFile", "NoImplicitWith"], runtime 16.0, platform 29.0.0.0, System symbols only; runtime 17.0 for the analysis view; runtime 18.0 +TranslationsWithNamespacesfor the namespaced one) with the localal compile, and the<trans-unit id>values (withal-object-target) andXliff Generatornotes were copied fromTranslations/TestApp.g.xlf. Every fixture compiled with no error; everyLocked = truevariant drops its unit. All 50 IDs are distinct; the view-layout fixtures modify controls of their own (MyViewField,MyExtViewField) because a modify inside a view hashes under the page without a view segment and would otherwise collide with the page extension field units.The fixture commit (d88bd4c) failed before the analyzer change: 59 failures, all
There is no issue reported for LC0091/ too few diagnostics (52HasDiagnostic: the 49 new modify cases, the add-and-modify view fixture and the two obsolete fixtures; 1HasDiagnosticWithNamespaces; 6 count cases); allLockedand translated cases passed (334 passed).No double report.
HasSingleDiagnosticForMemberAddedByExtensionis renamedHasSingleDiagnosticPerMarkerand now asserts exactly one LC0091 diagnostic per marker (diagnostic count equals marker count, each marker matched once). New cases:PageExtensionAddAndModifyViewCaption(addsMyExtViewand modifiesMyView, two markers, two diagnostics),PageCustomizationViewCaption,PageExtensionModifyFieldCaption,PageViewModifyFieldAboutTitle,PageExtensionViewModifyFieldAboutTitle,TableExtensionModifyFieldCaption,ReportExtensionModifyRequestPageFieldCaption; all pass after the change.Pinned-ID check: changing
PageCustomization 4276993442 - Change 3066929535 - Property 2879900210to…3066929536…madeNoDiagnosticTranslatedModifyChangeProperties("TranslatedPageCustomizationModifyActionGroupCaption")fail withMissing translation for 'Caption' in language(s): da-DK(1 failed, 392 passed); reverted.Findings that differ from the issue
layoutis not a non-report. It rejectsCaption,ToolTip,InstructionalTextandOptionCaption(AL0246), butAboutTitleandAboutTextcompile cleanly and the compiler writesPage MyPage - Change MyViewField - Property AboutTitle.ShouldVisitMemberskips the members of a change inside a view, not the change's own properties. LC0091 now reports these (fixtures above), also for a view a page extension adds.modify(part)ToolTipandmodify(action group)ToolTip; page customizationmodify(part)AboutTitle/AboutTextandmodify(action group)Caption/AboutTitle/AboutText(customization action groupCaptionis accepted, unlike field/group/part/actionCaption); report extension request page fieldInstructionalText,AboutTextandOptionCaption(on an Option variable).PageCustomization <h>butal-object-target="Page <h>".Deliberate non-reports (re-checked with the compiler)
requestpage { actions { modify(...) } }compiles and writes no unit (RequestPageExtensionObjectMembersbuilds from the layout only).dataset { modify(...) }:RequestFilterHeadingandCaptionfail with AL0246.modifyof field/group/part/action rejectsCaption,ToolTip,InstructionalText(AL0246);modify(view)rejectsToolTip(AL0124).modifyof a field in aRemovedtable compiles (warning AL0520) and the compiler still writesTable MyTable - Change MyField - Property Caption, so LC0091 reports it (IsLockedByCompilersees the Change, which is never Removed; no change needed). Amodifyof a field that is itselfRemovedfails with AL0433. APendingfield's modify is written and reported.Docs
.claude/rules/diagnostics/lc0091-translatable-text-should-be-translated.md:Changedesign decision (default branch, add wrappers/moves/field group adds carry no properties, no filter),PageCustomizationrow, obsolete gate note for modify blocks, deliberate non-reports, SDK facts (modify symbol events, empty defaultProperties,LabelWriterVisitorhandling of changes), test notes (ID shape<Root> - Change <hash> - Property <hash>, customization root, view-layout hashing, analysis view gating, count test).Companion docs PR: ALCops/alcops.dev#244
Verification
dotnet build ALCops.sln: 0 errors (6 pre-existing MSB3277 test-project warnings only)dotnet test ALCops.sln: all passed (LinterCop 851, PlatformCop 784, ApplicationCop 634, FormattingCop 246, DocumentationCop 107, TestAutomationCop 30, Common 169)GITHUB_ACTIONS=true dotnet test src/ALCops.LinterCop.Test/ --filter "FullyQualifiedName~TranslatableTextShouldBeTranslated" -c Release -p:NavTargetFramework=net8.0): 375 passed, 18 skipped (version-gated namespace, page object ToolTip and analysis view cases), 0 faileddotnet build src/ALCops.LinterCop/ALCops.LinterCop.csproj -c Release -p:ContinuousIntegrationBuild=true --no-incremental: netstandard2.1, net8.0, net10.0 built, 0 warnings, 0 errors (src/ALCops.Commonunchanged)dotnet format ALCops.sln --verify-no-changes: exit 0Validate-Rules.ps1: OK, 70 rules files (15 guides, 55 rule docs) pass all checks🤖 Generated with Claude Code