Skip to content

Release/v0.6.1#173

Merged
Arthurvdv merged 29 commits intomainfrom
release/v0.6.1
Apr 2, 2026
Merged

Release/v0.6.1#173
Arthurvdv merged 29 commits intomainfrom
release/v0.6.1

Conversation

@Arthurvdv
Copy link
Copy Markdown
Member

No description provided.

Arthur van de Vondervoort and others added 29 commits March 26, 2026 16:21
TransferFieldsSchemaCompatibility no longer reports diagnostics for
fields with ObsoleteState = Removed, since those fields are not
available at runtime and should not be compared.

- Add IsObsoleteRemoved() extension to SymbolInterfaceExtensions
- Filter out removed fields in both name and type mismatch checks
- Add NoDiagnostic test cases for obsolete-removed scenarios

Fixes #148

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sion field detection

- Fix bug: BuildEffectiveFields now includes table extension fields in
  the returned collection. Previously they were computed but discarded,
  so TransferFields() invocations never checked extension fields.
- Merge base table and extension fields into a single loop, eliminating
  duplicate id-range and IsRemoved filters.
- Extract FindFieldMismatches with FieldMismatch struct and MismatchKind
  enum, replacing two duplicated foreach loops.
- Extract CreateFieldDiagnostic, consolidating duplicated Diagnostic.Create
  logic from two ReportField overloads.
- Extract IsEitherFieldSuppressed helper for repeated suppression checks.
- Add #if NETSTANDARD2_1 guard on FieldMismatch for multi-target compat.
- Add 4 new test cases covering extension fields via the invocation path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skip obsolete-removed fields in TransferFields analyzers
API pages are machine-readable REST endpoints, not user-facing UI,
so captions are irrelevant. Previously only the page-level check
skipped API pages while controls and actions inside them were still
flagged.

Add an IsInApiPage early-return guard in CheckForMissingCaptions that
skips all symbols belonging to an API page. Remove the now-redundant
SuppressCaptionWarning method and the scattered partial API checks.

Closes #131

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix(AC0011): skip CaptionRequired for API pages entirely
Add TestTypeKind enum to EnumProvider and register it in the
CasingMismatchIdentifier property value dictionaries. This resolves
the false positive FC0002i diagnostic when using the TestType property
introduced in BC runtime 16.0.

Closes #133

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
feat: add TestType property support to FC0002 casing check
…entation)

Skip procedures in codeunits with Subtype = Test to avoid hundreds of
noise diagnostics on [Test] methods and handler methods that never
serve as public API.

Closes #146

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix: exclude test codeunits from DC0004 (PublicProcedureRequiresDocumentation)
…FC0002i

Replace manual 47-entry property value dictionaries with dynamic
discovery via PropertyInfoLookup.Lookup(), making the analyzer
self-maintaining as new AL SDK enum values are added.

Resolve property names through SemanticModel (GetSymbolInfo/
GetDeclaredSymbol) instead of static dictionaries, matching
VS Code IntelliSense behavior for canonical casing.

Batch identifier resolution by grouping on ValueText and resolving
one representative per group to reduce GetSymbolInfo calls.

Remove FC0002i debug diagnostic from DiagnosticIds, DiagnosticDescriptors,
resx, and auto-generated resource class.

Reorganize class into algorithm-phase regions: Tree Walk, Inline
Resolution, Batched Semantic Resolution, Comparison and Reporting,
Static Data.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ider

Remove dead code from EnumProvider.cs:
- 55 entire nested classes where CanonicalNames was the sole member
- 19 CanonicalNames fields from classes with other members
- CreateEnumDictionaryByName helper (only caller removed)

5 referenced entries preserved: StyleKind, AttributeKind, AreaKind,
ActionAreaKind, PropertyKind.

File reduced from 1897 to 1263 lines (33% reduction).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enum.GetValues<T>() is a .NET 5+ API unavailable on netstandard2.1.
Added conditional compilation to use the non-generic overload on
netstandard2.1 and the generic form on .NET 5+.

Files changed:
- CasingMismatchIdentifier.cs: wrap two Enum.GetValues<T>() calls
- CyclomaticComplexityAndMaintainabilityIndex.cs: add generic form
  in #else branch, keep non-generic for netstandard2.1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
refactor(FormattingCop): rewrite CasingMismatchIdentifier
API pages that expose no field controls (e.g., service-only pages with
[ServiceEnabled] procedures) no longer trigger PC0026. The rule now
returns early when fieldControls is empty.

Also fixes a copy-paste error in the test class where _analyzer
referenced FilterStringSingleQuoteEscaping instead of
MandatoryFieldMissingOnApiPage.

Closes #150

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix(PC0026): skip diagnostic on API pages without exposed fields
ObjectType::XmlPort was incorrectly flagged, suggesting Xmlport (lowercase p).
The _symbolKindDictionary remaps XmlPort→Xmlport, which is correct for type
references (Xmlport::MyXmlport) but wrong for ObjectType member access where
the SymbolKind enum canonical form is XmlPort (uppercase P).

Add _objectTypeMemberDictionary using raw SymbolKind enum names and use it
for right-side comparison when left side is ObjectType.

Cherry-picked from 9e698d3 (development) with conflict resolution.

Fixes #150

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix(FC0002): use correct XmlPort casing for ObjectType option access
* Fix DC0005 false positive with TryFunction and <returns> tag

Move TryFunction attribute detection before the excess return documentation
check so that <returns> tags on [TryFunction] methods are not flagged as
excess. TryFunction methods have an implicit boolean return, making <returns>
documentation valid.

Also fix NoDiagnostic/TryFunction.al test to place a marker on <returns> and
add a new TryFunctionEmptyReturns test case covering the exact scenario from
issue #149.

Fixes #149

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: rename procedure MyProcedure to MyTryFunction for consistency

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Change message from 'Enum "{0}" with value 0 must have an empty Name
and Caption.' to 'Enum value "{0}" with ordinal 0 should have an empty
Name and Caption.'

- Enum → Enum value (clarifies it refers to the enum member, not type)
- value 0 → ordinal 0 (avoids overloading 'value')
- must → should (matches Info severity)

Closes #168

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Narrow IsFieldBasedOptionAccess() to only match Option fields, not Enum
fields. Enum field-based member access (e.g., OtherTable.Field::Value)
now falls through to AreFieldCompatible(), which correctly handles enum
identity comparison via OriginalDefinition.Equals.

This fixes a regression from 8202a13 where cross-table enum field access
with the same underlying enum type was incorrectly flagged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix(PC0013): resolve false positive for cross-table enum field access
Pass the full, non-deduplicated source list to Display-Sources.ps1
so the workflow log shows entries from all providers (VSIX, NuGet,
BCArtifact) for each version. The deduplicated sources output used
by downstream workflows remains unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Show all sources (pre-dedup) in Display Sources step
String literals matching PageStyle enum values (e.g., 'None', 'Standard')
inside method invocations on data-access types no longer trigger LC0086.
This fixes false positives like Rec.SetRange(MyField, 'NONE') where the
string is a data filter value, not a page style.

Suppressed types: Record, RecordRef, FieldRef, Query, Variant,
DataTransfer, FilterPageBuilder, TableFilter.

Contexts that still flag (by design): if-comparisons, exit statements,
assignments to text variables, custom procedure arguments, Message calls.

Added FieldRef, DataTransfer, FilterPageBuilder to EnumProvider.NavTypeKind.
Added 5 new test cases (2 HasDiagnostic, 3 NoDiagnostic).

Closes #154

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix(LC0086): suppress false positives on data-access method invocations
@Arthurvdv Arthurvdv merged commit 6d436f0 into main Apr 2, 2026
121 of 122 checks passed
@Arthurvdv Arthurvdv deleted the release/v0.6.1 branch April 2, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant