Repository navigation
[Add] Element query extension methods for annotating comments and a documentation summary; refs #511 - #517
Merged
Conversation
…ocumentation summary, and their Handlebars helpers; refs #511
|
4 of 20 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.



Refs #511 (group 3 of 3: Package and Element)
Changes
New extension methods in
uml4net.Extensions:IElement.QueryAnnotatingComments(): the owned comments of the element, followed by the comments of its direct and indirect owners that have the element as annotated element (Comment::annotatedElement), nearest owner first.IElement.QuerySummary(int maxLength = 160): the first sentence ofQueryRawDocumentation, cut at the maximum length with an ellipsis when it is longer.New Handlebars helpers in
uml4net.HandleBars:Element.QueryAnnotatingComments, with the element as argumentDocumentationSummary, with the element and optionally the maximum length as argumentsQueryDocumentationandQueryRawDocumentationare not changed: they read the owned comments only.Where the methods come from
QueryAnnotatingCommentsQueryAllElementComments)Comment::annotatedElement.QuerySummaryQueryRawDocumentation, where the source joins the lines ofQueryDocumentationand collapses the white space. Throws for a maximum length below 1.Rejected, as recorded in #511:
QueryContainedAndImportedof SysML2.NET (QueryAllNestedAndImportedPackagescovers it),QueryAllElementCommentsIncludingEAof EORSADB (the Enterprise Architect reader adds that documentation as owned comments) andQueryDocumentationTextof mycelium-hypha (QueryRawDocumentationcovers it).A limit of QueryAnnotatingComments
A comment that annotates the element and that is owned by an element which is not one of its owners, for example a package next to the package of the element, is not returned. Finding those needs a search through the whole model for each element. The documentation comment of the method states this.
Tests
ElementExtensionsTestFixture: two tests, on elements built in the test, including the null argument and a maximum length of 0.DocumentationHelperTestFixture: one test for each new helper, including a wrong argument and a wrong number of arguments.Not in this pull request
🤖 Generated with Claude Code