You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Class Naming Rules**: Use `Inspection` as a suffix
172
-
-**Related Classes**
173
-
- Processor: Classes that check inspection target elements. Provides common check processing for inspection targets that meet specific conditions
174
-
-**Class Naming Rules**: Use `Checker` or `Processor` as a suffix depending on the purpose
175
-
- Provider: Provider that returns a list of `InspectionTool` subclasses
176
-
-**Class Naming Rules**: Use `Provider` as a suffix
177
-
- Visitor: Classes that search for inspection target elements. Called from `InspectionTool`
178
-
-**Class Naming Rules**: Have the same name as the calling `InspectionTool` with `Visitor` as a suffix
179
-
- QuickFix: Classes that provide fix actions for inspection results
180
-
- Consists of a `Factory` object that provides quick fix objects and the main `QuickFix` object
181
-
-**Class Naming Rules**
182
-
-`Factory` object: Use `QuickFixFactory` as a suffix
183
-
-`QuickFix` object: Use `QuickFix` as a suffix
184
-
-[ValidationResult](src/main/kotlin/org/domaframework/doma/intellij/common/validation/result): Classes that provide error messages and highlights for code inspection results
185
-
-**Class Naming Rules**: Use `ValidationResult` as a suffix. Name classes according to the message resources to be displayed
183
+
- Processor: Classes that check inspection target elements. Provides common check processing for inspection targets that meet specific conditions
184
+
-**Class Naming Rules**: Use `Checker` or `Processor` as a suffix depending on the purpose
185
+
- Provider: Provider that returns a list of `InspectionTool` subclasses
186
+
-**Class Naming Rules**: Use `Provider` as a suffix
187
+
- Visitor: Classes that search for inspection target elements. Called from `InspectionTool`
188
+
-**Class Naming Rules**: Have the same name as the calling `InspectionTool` with `Visitor` as a suffix
189
+
- QuickFix: Classes that provide fix actions for inspection results
190
+
- Consists of a `Factory` object that provides quick fix objects and the main `QuickFix` object
191
+
-**Class Naming Rules**
192
+
-`Factory` object: Use `QuickFixFactory` as a suffix
193
+
-`QuickFix` object: Use `QuickFix` as a suffix
194
+
-[ValidationResult](src/main/kotlin/org/domaframework/doma/intellij/common/validation/result): Classes that provide error messages and highlights for code inspection results
195
+
-**Class Naming Rules**: Use `ValidationResult` as a suffix. Name classes according to the message resources to be displayed
186
196
187
197
**Coding Rule**
188
198
For code inspection features, always implement `InspectionTool` and `Visitor` as separate classes.
@@ -191,14 +201,82 @@ When the logic within `Visitor` becomes complex, implement separate Processor cl
191
201
### Completion
192
202
Code completion functionality for DOMA directive syntax in SQL
- CompletionContributor: Entry point for code completion
196
-
-**Class Naming Rules**: Use `CompletionContributor` as a suffix
197
-
- Provider: Classes that provide completion candidates in specific contexts
198
-
-**Class Naming Rules**: Use `CompletionProvider` as a suffix
199
-
- Processor: Classes that filter and transform completion candidates
200
-
-**Class Naming Rules**: Use `Processor` as a suffix
201
-
-[Handler](src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive): Classes that generate suggestion candidates for each directive type
202
-
-**Class Naming Rules**: Use `Handler` as a suffix
203
-
-[Collector](src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/collector): Classes that collect directive suggestion candidates. Called from `Handler`
204
-
-**Class Naming Rules**: Use `Collector` as a suffix
204
+
- CompletionContributor: Entry point for code completion
205
+
-**Class Naming Rules**: Use `CompletionContributor` as a suffix
206
+
- Provider: Classes that provide completion candidates in specific contexts
207
+
-**Class Naming Rules**: Use `CompletionProvider` as a suffix
208
+
- Processor: Classes that filter and transform completion candidates
209
+
-**Class Naming Rules**: Use `Processor` as a suffix
210
+
-[Handler](src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive): Classes that generate suggestion candidates for each directive type
211
+
-**Class Naming Rules**: Use `Handler` as a suffix
212
+
-[Collector](src/main/kotlin/org/domaframework/doma/intellij/common/sql/directive/collector): Classes that collect directive suggestion candidates. Called from `Handler`
213
+
-**Class Naming Rules**: Use `Collector` as a suffix
214
+
215
+
### Refactoring
216
+
Functionality for renaming SQL files and directories when DAO classes or methods are renamed.
-**DaoMethodRenameProcessor**: Detects renaming of DAO method names and renames the corresponding SQL file.
220
+
-**DaoPackageRenameListenerProcessor**: Detects renaming of DAO class package names and renames the corresponding SQL directory. Implemented as a subclass of `RefactoringElementListenerProvider` to support changes from the project view.
221
+
-**DaoRenameProcessor**: Detects renaming of DAO class names and renames the corresponding SQL directory.
222
+
-**Class Naming Rules**: Use the `Processor` suffix.
223
+
- Use `canProcessElement()` to determine if the element is a rename target, and `renameElement()` to perform the rename. Since the original rename process is not executed, always call `super.renameElement()` at the end.
224
+
225
+
### Reference Resolution
226
+
Functionality for resolving references to the definition of elements inside Doma bind variables in SQL.
-**Contributor**: Registers reference resolution extension points in IntelliJ.
229
+
-**Class Naming Rules**: Use the `ReferenceContributor` suffix.
230
+
-**Provider**: Selects elements for reference resolution and delegates to the appropriate reference class.
231
+
-**Class Naming Rules**: Use the `ReferenceProvider` suffix.
232
+
- Bind variables may have parent-child relationships such as `SqlElFieldAccessExpr` > `SqlElIdExpr`. Resolution is performed from the smallest granularity upward for the most precise result.
233
+
-**Reference**: Performs the actual reference resolution. Implemented as subclasses of `SqlElExprReference` (which extends `PsiReferenceBase`).
234
+
-**SqlElClassExprReference**: Resolves fully qualified class names in static field access elements.
235
+
-**SqlElIdExprReference**: Resolves the smallest unit of bind variable elements (DAO parameters, fields, etc.).
236
+
-**SqlElForDirectiveIdExprReference**: Resolves elements defined within loop directives.
237
+
-**SqlElFunctionCallExprReference**: Resolves custom and built-in function references.
238
+
-**SqlElStaticFieldReference**: Resolves the top-level static field or method in static field access.
239
+
-**Class Naming Rules**: Use the `Reference` suffix.
240
+
-**Manipulator**: Supports renaming of reference target elements. Used to determine the reference range when the element text is changed.
241
+
-**Class Naming Rules**: Use the `Manipulator` suffix.
242
+
243
+
### Documentation
244
+
Functionality for displaying documentation for the definition of elements inside Doma bind variables in SQL.
-**Builder**: Entry point for formatting, implements the `FormattingModelBuilder` class.
257
+
-**SqlFormattingModelBuilder**: Provides formatting models for SQL.
258
+
-**SqlBlockRelationBuilder**: Sets parent-child relationships between blocks.
259
+
-**SqlBlockBuilder**: Manages the start and end blocks of conditional directives and group blocks.
260
+
-**SqlCustomSpacingBuilder**: Defines custom spacing settings for element types and blocks.
261
+
-**Class Naming Rules**: Use the `FormattingModelBuilder` suffix.
262
+
-**Block**: Classes representing the basic unit of formatting blocks.
263
+
- The abstract class `SqlBlock` is the base, and blocks are structured hierarchically according to the SQL structure.
264
+
-**SqlKeywordGroupBlock**: Represents keyword group blocks.
265
+
-**SqlSubGroupBlock**: Represents subgroups enclosed in `()`.
266
+
-**SqlElBlockCommentBlock**: Represents directive blocks such as `/*%if*/` and `/*%for*/`.
267
+
- Whether to preserve a newline before a block is determined by `isSaveSpace()`.
268
+
- The parent group block is held in `parentBlock`.
269
+
- The block's own indent is calculated by `createBlockIndentLen()`, and the indent base for child elements in its group is calculated by `createGroupIndentLen()`.
270
+
-**Class Naming Rules**: Use the `Block` suffix.
271
+
-**Util**: Utility classes related to formatting.
272
+
- Provides block object generation by branching and line break determination by keyword combinations.
273
+
-**Class Naming Rules**: Use the `Util` suffix.
274
+
-**Handler**: Provides custom spacing settings and block class determination according to query type.
275
+
-**Processor**: Classes that determine spacing between blocks.
276
+
-**InjectionSqlFormatter**: Provides common formatting for injected SQL.
277
+
-**SqlInjectionPostProcessor**: Applies formatting to injected SQL in DAOs. Independently invokes formatting and executes reformatting from the `SqlFormatPreProcessor` for SQL.
278
+
-**SqlFormatPreProcessor**: Inserts line breaks before the main SQL formatting process. Not automatically executed for injected SQL formatting.
279
+
-**SqlFormatPostProcessor**: Removes trailing spaces and adds a newline at the end of SQL after formatting.
280
+
-**Class Naming Rules**: Use the `Processor` suffix.
281
+
-**Visitor**: Visitor classes for collecting target elements to process within Processor.
0 commit comments