diff --git a/enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt b/enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt index 6b7c469a..e03169c5 100644 --- a/enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt +++ b/enro-lint/src/main/java/dev/enro/lint/EnroIssueDetector.kt @@ -120,7 +120,7 @@ class EnroIssueDetector : Detector(), Detector.UastScanner { context.report( issue = missingNavigationDestinationAnnotationCompose, location = context.getLocation(node), - message = "${composableParent.name} is not marked as a NavigationDestination.\nRequesting a TypedNavigationHandle in this way may be cause a crash if ${composableParent.name} is called from a NavigationDestination that is not bound to '${navigationHandleGenericType.presentableText}'", + message = "@Composable function '${composableParent.name}' is not annotated with '@NavigationDestination(${navigationHandleGenericType.presentableText})'", quickfixData = fix() .name("Add NavigationDestination to ${composableParent.name}") .replace() diff --git a/enro-lint/src/main/java/dev/enro/lint/Issues.kt b/enro-lint/src/main/java/dev/enro/lint/Issues.kt index d4288c09..8b3a8f18 100644 --- a/enro-lint/src/main/java/dev/enro/lint/Issues.kt +++ b/enro-lint/src/main/java/dev/enro/lint/Issues.kt @@ -31,7 +31,12 @@ val missingNavigationDestinationAnnotation = Issue.create( val missingNavigationDestinationAnnotationCompose = Issue.create( id = "MissingNavigationDestinationAnnotation", briefDescription = "Missing Navigation Destination Annotation", - explanation = "Attempting to create a NavigationHandleProperty inside a Composable that is not marked as a NavigationDestination", + explanation = "Requesting a TypedNavigationHandle here may cause a crash, " + + "as there is no guarantee that the nearest NavigationHandle has a NavigationKey of the requested type.\n\n" + + "This is not always an error, as there may be higher-level program logic that ensures this will succeed, " + + "but it is important to understand that this works in essentially the same way as an unchecked cast. " + + "If you do not need a TypedNavigationHandle, you can request an untyped NavigationHandle by removing the type" + + "arguments provided to the `navigationHandle` function", category = Category.PRODUCTIVITY, priority = 5, severity = Severity.WARNING,