-
Notifications
You must be signed in to change notification settings - Fork 0
Error message details #162
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
…op element of a field access
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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 case-specific error messages during field-access element parsing and refactors the SQL inspection visitor code by extracting distinct processing tasks into dedicated processor classes. Key changes include:
- Enhanced error messages and validations in both SQL and Java/Kotlin inspection components.
- Extraction of processor classes (e.g. InspectionStaticFieldAccessVisitorProcessor, InspectionPrimaryVisitorProcessor, etc.) to modularize SQL processing tasks.
- Updates to test data and message bundles to support the new error cases.
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| duplicateForDirectiveDefinitionNames.sql | Added test SQL with duplicate for directive definitions to trigger the new error reporting. |
| DaoMethodVariableInspectionTestDao.java | Updated method signatures and inline error markers to reflect duplicate parameter scenarios. |
| DomaUseVariableTest.kt | Updated test to include the new duplicate for directive definition SQL. |
| DomaToolsBundle_ja.properties & DomaToolsBundle.properties | Added and modified error message keys for specific SQL inspection error cases. |
| SqlElIdExprReference.kt, SqlVisitorBase.kt, SqlInspectionVisitor.kt | Adjusted references and integrated new processor classes for error validations. |
| Inspection Visitor Processors (several files) | Introduced dedicated processor classes for static field access, primary expressions, for directive, and field access validations. |
| DaoMethodVariableInspector.kt | Updated logic to differentiate between duplicate for directive definitions and unused SQL parameters. |
| DocumentDaoParameterGenerator.kt, SqlParameterCompletionProvider.kt | Minor adjustments to ensure proper type handling in for directive processing. |
| ForDirectiveUtil.kt & Validation Results | Modified utility functions to incorporate DAO method context for determining class types and error highlight results. |
Comments suppressed due to low confidence (1)
src/main/kotlin/org/domaframework/doma/intellij/common/util/ForDirectiveUtil.kt:382
- The function 'getTopForDirectiveDeclarationClassType' is expected to return a PsiParentClass or null, but this branch returns a ValidationNotFoundTopTypeResult, which may violate the method's type contract. Consider returning null or refactoring to ensure consistent return types that match PsiParentClass?
val classType = parentType as? PsiClassType ?: return ValidationNotFoundTopTypeResult(blocks.first(), shortName)
58a7bc0 to
a6993ba
Compare
Add case-specific error messages for exceptional scenarios during field-access element parsing. Errors are now reported for:
Iterabletype.staticandpublic.Additionally, refactor the SQL inspection Visitor by extracting each processing task into separate Processor classes.