-
Notifications
You must be signed in to change notification settings - Fork 0
Add A reference to the SQL symbol type definer #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…to feature/sql-symbol-reference # Conflicts: # src/main/java/org/domaframework/doma/intellij/Sql.bnf
There was a problem hiding this 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 introduces a reference jump feature for SQL symbols in the IntelliJ plugin, enabling Ctrl+click functionality from SQL bind variables to their corresponding definitions in DAO methods, class properties, or static fields. Key changes include a method renaming in the test suite, various updates to reference provider implementations to use new language constructs (e.g. SqlElIdExpr instead of SqlElPrimaryExpr), and adjustments in completion and inspection logic based on improved type checking.
Reviewed Changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/kotlin/org/domaframework/doma/intellij/DomaSqlTest.kt | Renamed test resource addition method to clarify intent |
| src/main/kotlin/org/domaframework/doma/intellij/reference/* | Updated reference provider implementations to use new identifier types and improved parent lookup logic |
| src/main/kotlin/org/domaframework/doma/intellij/inspection/* | Adjusted inspection logic to filter out false-positive cases using new element type checks |
| src/main/kotlin/org/domaframework/doma/intellij/contributor/sql/* | Refined SQL completion and jump-to-declaration logic using updated language constructs and patterns |
| src/main/java/org/domaframework/doma/intellij/psi/* | Introduced or updated classes for custom SQL expressions, ensuring proper reference resolution |
Files not reviewed (2)
- src/main/java/org/domaframework/doma/intellij/Sql.bnf: Language not supported
- src/main/resources/META-INF/plugin.xml: Language not supported
Comments suppressed due to low confidence (3)
src/test/kotlin/org/domaframework/doma/intellij/DomaSqlTest.kt:151
- The method rename from 'addResourceFile' to 'addResourceEmptyFile' improves clarity; please verify that all test invocations are updated accordingly to avoid mismatches.
fun addResourceEmptyFile(vararg sqlFileNames: String) {
src/main/kotlin/org/domaframework/doma/intellij/action/sql/JumpToDeclarationFromSqlAction.kt:167
- Using PsiTreeUtil to retrieve the parent of a static element enhances robustness; please ensure that the source variable (staticDirection) is consistently defined and that the intended element is always targeted.
val classParent = PsiTreeUtil.getParentOfType(staticDirection, SqlElClass::class.java)
src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/inspector/DaoMethodVariableInspector.kt:100
- The updated condition relies on checking the elementType instead of an instanceof check; confirm that this condition accurately identifies all relevant identifier cases without inadvertently filtering out valid references.
if (element.elementType == SqlTypes.EL_IDENTIFIER && element.prevSibling?.elementType != SqlTypes.DOT) {
Enables you to jump from a bind variable symbol to its definition by using Ctrl+click.
The target is Dao method argument parameters, class properties, and static property call classes.