Fix children count mismatch and enhance query entry labeling#50
Merged
Merged
Conversation
- QueryEngine.Describe now derives its 'Children: N' summary count from the same filtered entries list used to build the Entries table, so the count can never diverge from the number of rows actually shown (previously it counted every raw AST child node, including non-element comments/metadata annotations/imports that have no QualifiedName and are excluded from Entries). - QueryResultRenderer.RenderMarkdown now precedes each verb's entries table (or its 'no entries' fallback) with a verb-specific bold-text label (e.g. **Children** for describe, **Uses** for uses), so an empty result reads as an unremarkable, expected outcome for that verb instead of an ambiguous, possibly-broken one. The label is always plain bold text, never an ATX heading, so the report stays within a single Markdown section regardless of the caller's requested heading depth. - Added/updated unit and integration tests, design docs, reqstream requirements, and verification test-scenario write-ups. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
This pull request introduces significant improvements to the clarity and usability of Markdown output generated by the SysML2Tools Query subsystem. The most important changes ensure that the
describeverb and other query verbs now provide a more accurate and user-friendly summary and entries section: the child count in summaries always matches the number of visible, named children, and each entries table (or its absence) is clearly labeled with a verb-specific bold-text label. This makes reports easier to read and interpret, especially when there are zero results. Several new tests and documentation updates accompany these changes to guarantee correctness and document the new behavior.Markdown Output Improvements:
The entries table in Markdown output is now always preceded by a verb-specific bold-text label (e.g.,
**Children**fordescribe,**Uses**foruses), and when there are no entries, a verb-specific fallback message is shown (e.g.,_No children._). This label is always plain bold text, never a Markdown heading, so the report remains in a single section. Thedependenciesverb remains an exception, using prose bullets without a label. [1] [2] [3] [4]For verbs without a specific label mapping, a generic
**Entries**label and_No entries._fallback are used, ensuring future verbs render sensibly. [1] [2]Summary and Child Count Accuracy:
describeverb summary now reports aChildren: Nline whereNis the count of visible, named children actually included in the entries table—never the raw count of AST child nodes. This prevents confusion when non-element children or hidden stdlib children are present but not listed. [1] [2] [3] [4]Documentation and Requirements Updates:
.md,.yaml) have been updated to describe the new Markdown output format, child count semantics, and rationale for these changes. This includes new or revised requirement sections and scenario/test documentation. [1] [2] [3] [4] [5]Test Coverage:
Childrencount matches the actual number of listed children. [1] [2] [3]These changes collectively improve the clarity, correctness, and maintainability of query results, making them more intuitive for users and easier to embed in other documentation.