Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented May 9, 2025

Fixed to handle the "has_next" and "_index" element types as primitive types.

  • _has_next: Boolean⇒boolean
  • _index: Integer⇒int

Fix for:
#150

@xterao xterao added this to the 0.7.0 Release milestone May 9, 2025
@xterao xterao requested a review from Copilot May 9, 2025 06:37
@xterao xterao self-assigned this May 9, 2025
@xterao xterao added bug Something isn't working fix Bug fixes labels May 9, 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 updates the handling of the "_has_next" and "_index" element types to be treated as primitive types (boolean and int) rather than their wrapper types. Key changes include updates to SQL test files, adjustments to documentation string expectations in tests, and refactoring of the type resolution logic in the ForDirectiveUtil.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/testData/src/main/resources/META-INF/doma/example/dao/document/DocumentTestDao/documentForItemElementByFieldAccess.sql Updated comment to reflect boolean treatment for employees_has_next.
src/test/testData/src/main/resources/META-INF/doma/example/dao/SqlCompleteTestDao/completeForItemIndex.sql Removed unnecessary suffix (".FALSE") from the item_has_next completion.
src/test/testData/src/main/resources/META-INF/doma/example/dao/EmployeeSummaryDao/bindVariableForItemHasNextAndIndex.sql Corrected inline references for member_has_next and member_index.
src/test/kotlin/org/domaframework/doma/intellij/document/SqlSymbolDocumentTestCase.kt Updated expected type links from Boolean/Integer to boolean/int.
src/test/kotlin/org/domaframework/doma/intellij/complate/sql/SqlCompleteTest.kt Adjusted completion tests to match the updated primitive type handling.
src/main/kotlin/org/domaframework/doma/intellij/common/util/ForDirectiveUtil.kt Simplified type resolution using PsiTypes and added a TODO comment for error messaging.

xterao and others added 3 commits May 9, 2025 15:38
…ord-element-handling' into fix/fordirective-item-specific-word-element-handling

# Conflicts:
#	src/main/kotlin/org/domaframework/doma/intellij/common/util/ForDirectiveUtil.kt
@xterao xterao linked an issue May 9, 2025 that may be closed by this pull request
@xterao xterao merged commit 5b5f561 into main May 9, 2025
3 checks passed
@xterao xterao deleted the fix/fordirective-item-specific-word-element-handling branch May 9, 2025 06:56
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.

hasNext, Index type reference

2 participants