Skip to content
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

Remove the link between creators and parent handlers #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CodeDrivenMitch
Copy link
Member

Remove the link between creators and parent handlers since they were odd to some customers.
References now show the method signature (and sometimes line number).

…odd to some customers. References now show the method signature (and sometimes line number).
@CodeDrivenMitch CodeDrivenMitch added this to the 0.8.0 milestone Nov 29, 2022
@CodeDrivenMitch CodeDrivenMitch self-assigned this Nov 29, 2022
@CodeDrivenMitch CodeDrivenMitch requested review from a team, gklijs and smcvb and removed request for a team November 29, 2022 15:59
Copy link
Member

@smcvb smcvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bunch of questions to better understand what's happening here. Not blocking right now, as I am just not familiar enough with it at this stage.

@@ -33,6 +33,7 @@ enum class AxonAnnotation(val annotationName: String) {
AGGREGATE_MEMBER("org.axonframework.modelling.command.AggregateMember"),
ROUTING_KEY("org.axonframework.commandhandling.RoutingKey"),
ENTITY_ID("org.axonframework.modelling.command.EntityId"),
PROCESSING_GROUP("org.axonframework.config.ProcessingGroup")
PROCESSING_GROUP("org.axonframework.config.ProcessingGroup"),
SAGA("org.axonframework.config.ProcessingGroup")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this refer to the sage annotation instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Furthermore, what does this change have to do with the PR's intent of removing the link between creators and parent handlers?

@@ -34,7 +34,7 @@ import javax.swing.Icon
data class DefaultMessageCreator(
override val element: PsiElement,
override val payload: String,
override val parentHandler: Handler?,
val isDeadline: Boolean = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR now seems to implement more than just removal of linked parent handlers to creators. Was that intended?

@@ -34,7 +34,7 @@ import javax.swing.Icon
data class DefaultMessageCreator(
override val element: PsiElement,
override val payload: String,
override val parentHandler: Handler?,
val isDeadline: Boolean = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless of the previous answer, having something called "default message creator" have a concept of whether it's a deadline makes it less default to me. I'd more so think you'd be dealing with a specific DeadlineMessageCreator in this case.

@@ -49,7 +49,7 @@ class ClassLineMarkerProvider : LineMarkerProvider {
if (handlers.isNotEmpty()) {
return AxonNavigationGutterIconRenderer(
icon = AxonIcons.Axon,
popupTitle = "Axon References To This Class",
popupTitle = "Axon References To $qualifiedName",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a bug fix you've sneaked into this PR.

@@ -28,7 +28,7 @@ import org.axonframework.intellij.ide.plugin.util.toQualifiedName
/**
* Searches for any event handlers that are not part of the aggregate model.
*
* @see org.axonframework.intellij.ide.plugin.handlers.types.EventHandler
* @see org.axonframework.intellij.ide.plugin.resolving.handlers.types.EventHandler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a documentation fix you've sneaked into this PR.

@@ -35,7 +35,7 @@ data class QueryHandler(
override val handlerType: MessageHandlerType = MessageHandlerType.QUERY

override fun renderText(): String {
return "${element.containingClassname()}.${element.name}"
return element.toViewText()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am certainly not deep enough into this stuff to understand how this solves the predicament of this PR. Would you care to explain this?

} else toPackageName()
}

fun PsiMethod.toViewText(): String {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you've just 'generified' the entire naming scheme. This makes sense.

@@ -43,7 +43,7 @@ class DeadlineHandlerMethodLineMarkerProviderTest : AbstractAxonFixtureTestCase(
)
assertThat(hasLineMarker(DeadlineHandlerMethodLineMarkerProvider::class.java)).isTrue
assertThat(getLineMarkerOptions(DeadlineHandlerMethodLineMarkerProvider::class.java)).containsExactly(
OptionSummary("MyCommand", null, AxonIcons.Publisher)
OptionSummary("MyAggregate.handle(MyCommand, DeadlineManager):${actualLineNumber(9)}", "my_special_deadline", AxonIcons.Publisher)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's the toViewText method you've added, causing the line number to be added, but I don't clearly see how. Would you mind elaborating on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants