-
Notifications
You must be signed in to change notification settings - Fork 0
Dynamic retrieval of source directory names #181
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
Dynamic retrieval of source directory names #181
Conversation
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 updates the file‐resolution logic to dynamically retrieve source and resource directory paths from each module’s configuration instead of using hard-coded values. It also refactors DAO and SQL file lookup methods, simplifies import statements, and removes deprecated or unused code.
- Dynamically retrieves module directories (source, resource, test source, test resource) using CommonPathParameter.
- Refactors DAO package renaming and SQL file path utilities to improve maintainability.
- Removes unused code (e.g. BindVariableElement, redundant overrides) and updates file paths in test cases.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/test/kotlin/org/domaframework/doma/intellij/DomaSqlTest.kt | Updates hard-coded directory paths to use dynamic variables. |
| src/main/kotlin/org/domaframework/doma/intellij/refactoring/dao/DaoPackageRenameListenerProcessor.kt | Adjusts handling of VirtualFile objects and package moves in DAO renaming. |
| src/main/kotlin/org/domaframework/doma/intellij/gutter/sql/SqlLineMakerProvider.kt | Introduces PsiDaoMethod for improved SQL file method checks. |
| src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/subgroup/SqlUpdateValueGroupBlock.kt | Removes unused code for constructing block indentation lengths. |
| src/main/kotlin/org/domaframework/doma/intellij/extension/ModuleExtensions.kt | Replaces old path formatting with new relative SQL file path resolution. |
| src/main/kotlin/org/domaframework/doma/intellij/common/psi/PsiDaoMethod.kt | Refactors SQL file path logic and introduces dynamic test file detection. |
| src/main/kotlin/org/domaframework/doma/intellij/common/dao/DaoMethodUtil.kt | Updates DAO file search logic with improved path resolution. |
| src/main/kotlin/org/domaframework/doma/intellij/common/CommonPathParameter.kt | Replaces static paths with dynamic retrieval of module source/resource directories. |
| Others | Minor cleanups in formatting and removal of obsolete methods. |
Comments suppressed due to low confidence (1)
src/main/kotlin/org/domaframework/doma/intellij/common/psi/PsiDaoMethod.kt:76
- The variable 'daoFile' is used in setTest() but is not defined within this scope. Replace 'daoFile' with the appropriate variable (for example, psiMethod.containingFile.virtualFile) or ensure that 'daoFile' is properly defined before its usage.
isTest = pathParameter.isTest(daoFile)
371c551 to
2edd8fe
Compare
Update the file-resolution logic to dynamically retrieve the source and resource directory paths from each module’s configuration, instead of using hard-coded values. Also include test source and test resource directories, and limit the DAO/SQL file search scope to the module.