Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented May 13, 2025

Add element names defined by the for directive to code-completion suggestions.

When performing code completion at the top level of a bind variable, include the directive’s element names as well as _has_next and _index in the suggestions.

@xterao xterao added this to the 0.7.0 Release milestone May 13, 2025
@xterao xterao requested a review from Copilot May 13, 2025 02:52
@xterao xterao self-assigned this May 13, 2025
@xterao xterao added enhancement New feature or request feature labels May 13, 2025
@xterao xterao linked an issue May 13, 2025 that may be closed by this pull request
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 enhances code completion by including element names defined in for directives along with _has_next and _index suggestions.

  • Added a new test SQL file and corresponding DAO method for directive item completion.
  • Updated Kotlin tests to verify the new completion suggestions.
  • Modified the SQL Parameter Completion Provider to integrate for directive items into the suggestions.

Reviewed Changes

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

File Description
src/test/testData/src/main/resources/META-INF/doma/example/dao/SqlCompleteTestDao/completeForDirectiveItem.sql Added SQL test file for for directive code completion.
src/test/testData/src/main/java/doma/example/dao/SqlCompleteTestDao.java Introduced a new DAO method to test directive item completion.
src/test/kotlin/org/domaframework/doma/intellij/complate/sql/SqlCompleteTest.kt Updated test cases to include the new directive item completion file and expected suggestions.
src/main/kotlin/org/domaframework/doma/intellij/contributor/sql/provider/SqlParameterCompletionProvider.kt Revised methods to include for directive completions based on PSI element position.

@xterao xterao merged commit 68c9bb6 into main May 13, 2025
3 checks passed
@xterao xterao deleted the feature/add-suggestion-for-directive-item branch May 13, 2025 04:09
@xterao xterao linked an issue May 15, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code completion fix for directive element name Code completion now shows for item definition names

2 participants