Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented May 27, 2025

Fix the error message shown when a custom-function call is invalid. The doma.compile.
config content that specifies the function-definition class is cached and only refreshed when the file’s last-modified timestamp changes.

To help users verify that their updated settings have been picked up, include the referenced class name in the error message during code inspection.

@xterao xterao self-assigned this May 27, 2025
@xterao xterao added bug Something isn't working fix Bug fixes labels May 27, 2025
@xterao xterao requested a review from Copilot May 27, 2025 05:25
@xterao xterao added this to the 0.8.0 Release milestone May 27, 2025
@xterao xterao linked an issue May 27, 2025 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a 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 enhances the invalid custom-function error message to include the configured function-definition class name and adds documentation about config caching.

  • Updated both English and Japanese message bundles to append a class-name placeholder
  • Extended the validator result and visitor processor to pass the custom-function class into the error message
  • Documented caching behavior in the README
Comments suppressed due to low confidence (3)

src/main/resources/messages/DomaToolsBundle_ja.properties:15

  • The Japanese resource still contains the English phrase 'in class [{1}]'. Please replace this with a proper Japanese translation for consistency.
inspection.invalid.sql.notFound.customFunction=定義されていない組み込み関数またはカスタム関数が呼び出されています:[{0}] in class [{1}]

src/main/kotlin/org/domaframework/doma/intellij/common/sql/validator/result/ValidationInvalidFunctionCallResult.kt:29

  • [nitpick] The parameter expressionClassName represents the custom-function class name; consider renaming it to customFunctionClassName for clarity and to match other identifiers.
private val expressionClassName: String,

src/main/kotlin/org/domaframework/doma/intellij/common/sql/validator/result/ValidationInvalidFunctionCallResult.kt:44

  • There are currently no tests verifying that the error message includes the class name. Adding unit tests for ValidationInvalidFunctionCallResult#setHighlight would ensure this new behavior is covered.
expressionClassName,

xterao and others added 3 commits May 27, 2025 14:28
…nction-invocation' into fix/update-message-for-custom-function-invocation

# Conflicts:
#	src/main/kotlin/org/domaframework/doma/intellij/inspection/sql/processor/InspectionFunctionCallVisitorProcessor.kt
@xterao xterao merged commit ff3a34e into main May 27, 2025
3 checks passed
@xterao xterao deleted the fix/update-message-for-custom-function-invocation branch May 27, 2025 06:12
@xterao xterao linked an issue May 27, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update error message for custom-function validation Update Error Message for Custom Function Invocation

2 participants