-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a bug fix you've sneaked into this PR. |
||
tooltipText = "Navigate to message handlers and creations", | ||
emptyText = "No references were found", | ||
elements = NotNullLazyValue.createValue { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2022. Axon Framework | ||
* Copyright (c) (2010-2022). Axon Framework | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -18,8 +18,8 @@ package org.axonframework.intellij.ide.plugin.resolving.creators | |
|
||
import com.intellij.psi.PsiElement | ||
import org.axonframework.intellij.ide.plugin.AxonIcons | ||
import org.axonframework.intellij.ide.plugin.api.Handler | ||
import org.axonframework.intellij.ide.plugin.api.MessageCreator | ||
import org.jetbrains.kotlin.idea.core.util.getLineNumber | ||
import javax.swing.Icon | ||
|
||
/** | ||
|
@@ -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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
) : MessageCreator { | ||
|
||
/** | ||
|
@@ -45,9 +45,13 @@ data class DefaultMessageCreator( | |
} | ||
|
||
override fun renderText(): String { | ||
if (parentHandler != null) { | ||
return parentHandler.renderText() | ||
return super.renderText() + ":" + element.getLineNumber() | ||
} | ||
|
||
override fun renderContainerText(): String? { | ||
if (isDeadline) { | ||
return payload | ||
} | ||
return super.renderText() | ||
return null | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2022. Axon Framework | ||
* Copyright (c) (2010-2022). Axon Framework | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a documentation fix you've sneaked into this PR. |
||
*/ | ||
class EventHandlerSearcher : AbstractHandlerSearcher(MessageHandlerType.EVENT) { | ||
override fun createMessageHandler(method: PsiMethod, annotation: PsiClass?): Handler? { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2022. Axon Framework | ||
* Copyright (c) (2010-2022). Axon Framework | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -19,7 +19,7 @@ package org.axonframework.intellij.ide.plugin.resolving.handlers.types | |
import com.intellij.psi.PsiMethod | ||
import org.axonframework.intellij.ide.plugin.api.Handler | ||
import org.axonframework.intellij.ide.plugin.api.MessageHandlerType | ||
import org.axonframework.intellij.ide.plugin.util.containingClassname | ||
import org.axonframework.intellij.ide.plugin.util.toViewText | ||
|
||
/** | ||
* Represents a method being able to handle a query. | ||
|
@@ -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() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
} | ||
|
||
override fun renderContainerText(): String { | ||
|
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.
Shouldn't this refer to the sage annotation instead?
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.
Furthermore, what does this change have to do with the PR's intent of removing the link between creators and parent handlers?