-
Notifications
You must be signed in to change notification settings - Fork 0
Code completion and code inspection for static property call package class names #148
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
20008f7 to
a50237e
Compare
a50237e to
1bf5898
Compare
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 implements code completion and inspection for static property call package class names. It introduces new collectors for static properties, class package suggestions, and build functions, refactoring existing retrievals of Java classes to use project-based extensions.
- Added new project extension for retrieving Java classes.
- Implemented new collectors: StaticPropertyCollector, StaticClassPackageCollector, and StaticBuildFunctionCollector.
- Refactored static directive handling to use the new collectors.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/kotlin/org/domaframework/doma/intellij/extension/ProjectExtensions.kt | Adds a new getJavaClazz function to retrieve PsiClass based on a fully qualified name. |
| src/main/kotlin/org/domaframework/doma/intellij/contributor/sql/provider/SqlParameterCompletionProvider.kt | Updates usage of getJavaClazz to use the project extension. |
| src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/collector/StaticPropertyCollector.kt | Implements a collector for static property completion suggestions. |
| src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/collector/StaticDirectiveHandlerCollector.kt | Adds an abstract base for static directive handler collectors. |
| src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/collector/StaticClassPackageCollector.kt | Introduces package collection via package and file lookups for completion suggestions. |
| src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/collector/StaticBuildFunctionCollector.kt | Implements built-in functions collector for SQL directives. |
| src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/StaticDirectiveHandlerData.kt | Defines data structures for static directive completions. |
| src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/StaticDirectiveHandler.kt | Refactors static directive handling to use the new collectors. |
| src/main/kotlin/org/domaframework/doma/intellij/common/psi/PsiStaticElement.kt | Updates getRefClazz to use the project-based getJavaClazz. |
| src/main/kotlin/org/domaframework/doma/intellij/common/FileTypeCheck.kt | Adds a helper function for checking if a file is a Java or Kotlin file. |
Comments suppressed due to low confidence (2)
src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/collector/StaticClassPackageCollector.kt:67
- Consider using an equality check (==) instead of contains when matching package names if an exact match is intended, to avoid unintended fuzzy matching.
subPackagesParent = parentPackages?.find { it?.name?.contains(pkg) == true }
src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/collector/StaticBuildFunctionCollector.kt:65
- [nitpick] Multiple DomaFunction instances are defined with the same name 'roundDownTimePart' but different type information. Consider differentiating the function names or adding documentation to clarify their intended usage.
DomaFunction("roundDownTimePart", getJavaLangString(), listOf(getPsiTypeByClassName("java.lang.CharSequence"), getPsiTypeByClassName("java.lang.Char")))
74320e9 to
44b293d
Compare
…erty calls, and test cases for the Inspect feature.
…for static property calls
Supports code completion, code inspection for the class package and class name where the staticProperty is called.