Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented May 15, 2025

When generating docs for elements defined by a for directive, if a DAO parameter had the same element name its information was being pulled instead. This change ensures that documentation for for directive elements always refers to the directive’s own definitions, not conflicting DAO parameters.

@xterao xterao added this to the 0.7.0 Release milestone May 15, 2025
@xterao xterao requested a review from Copilot May 15, 2025 02:26
@xterao xterao self-assigned this May 15, 2025
@xterao xterao added bug Something isn't working fix Bug fixes labels May 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the issue where documentation for elements defined with the for directive was incorrectly pulling DAO parameter information. The changes ensure that for directive–defined elements refer solely to their own definitions.

  • Updated SQL test file to simulate a for directive element.
  • Added a new DAO method to support the test case.
  • Modified the DocumentDaoParameterGenerator to bypass DAO parameter lookup when a for directive is present.
  • Included a new test in SqlSymbolDocumentTestCase to validate the fix.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
documentForItemInvalidPrimary.sql Added SQL test file for verifying that for directive elements use their own definitions.
DocumentTestDao.java Introduced a new DAO method to support testing of invalid primary parameter documentation.
SqlSymbolDocumentTestCase.kt Added a test case to ensure the correct documentation text is returned for for directive elements.
DocumentDaoParameterGenerator.kt Updated parameter lookup logic to skip DAO parameter search when a for directive is detected.
Comments suppressed due to low confidence (2)

src/test/testData/src/main/resources/META-INF/doma/example/dao/document/DocumentTestDao/documentForItemInvalidPrimary.sql:4

  • [nitpick] The inline comment in the SQL test contains a caret marker (''). Confirm if this marker is intentional for testing purposes or remove it if it was left accidentally.
name = /* ite<caret>m.name */'name'

src/test/kotlin/org/domaframework/doma/intellij/document/SqlSymbolDocumentTestCase.kt:151

  • [nitpick] The test expectation includes a leading space which may be fragile; verify that the intended output should include this whitespace.
val result = " item"

@xterao xterao merged commit 49e358d into main May 15, 2025
3 checks passed
@xterao xterao deleted the fix/documentasion-for-item branch May 15, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants