Code Monkey home page Code Monkey logo

eventbus-plugin's People

Contributors

thsaravana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eventbus-plugin's Issues

Add Support fo Enums

enum class KotlinEnumType {
    ONE
}
    @Subscribe
    fun kotlinMethod10(type: KotlinEnumType) {
        println("kotlinMethod10 executed")
    }
bus.post(KotlinEnumType.ONE)

Add support for post and @Subscribe.
Both in Java and Kotlin.

LineMarker refers to old PsiElement

When the LineMarkerInfo is created, we pass the UElement along with it. So when the marker is clicked, we use this UElement. There are chances that this reference can be outdated and we end up processing an outdated element. This has caused either incorrect find usages, or exceptions.

Align the LineMarker to LEFT

LineMarkers are annoyingly getting in way while adding and removing breakpoints. So change the alignment from RIGHT to LEFT.

Add ability to Set and Clear breakpoints

In case of subscribe, I think we need to add breakpoint to the first statement of the Method, but if that proves difficult we could just add a Method breakpoint.

In post, we need to test scenario where the statement is written in multiple lines. And we need to add the breakpoint the proper line.

Subscribe to Post wont work for cases like `post(getMethod())`

fun getMethod() : Type = Unit

bus.post(getMethod())

@Subscribe
fun subcribe(type: Type) {
}

In the above case, Post to Subscribe connection would work. But Subscribe to Post connection doesn't. We first need to find the usages of Type.. and from that find out the usages were Type is a return type of a Method. Then take those methods and find usages for those and then filter out all the cases where the method is used as a ValueArgument of post method. This will establish the connection.

TypeCastException when empty parameter in `post`

In the below scenario:
bus.post()
we get TypeCastException.

I know the IDE itself will throw a syntax error, since post() doesn't take any parameter, but still we show the EventBus marker. Clicking on that throws the below error:

kotlin.TypeCastException: null cannot be cast to non-null type com.intellij.psi.impl.source.PsiClassReferenceType
	at com.madrapps.eventbus.post.PostLineMarkerInfo$1.navigate(PostLineMarkerProvider.kt:65)
	at com.intellij.codeInsight.daemon.NavigateAction.actionPerformed(NavigateAction.java:56)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:261)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:278)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:252)
	at com.intellij.openapi.editor.impl.EditorGutterComponentImpl.performAction(EditorGutterComponentImpl.java:1817)
	at com.intellij.openapi.editor.impl.EditorGutterComponentImpl.mouseReleased(EditorGutterComponentImpl.java:1777)
	at com.intellij.openapi.editor.impl.EditorImpl.processMouseReleased(EditorImpl.java:2307)
	at com.intellij.openapi.editor.impl.EditorImpl.access$9800(EditorImpl.java:123)
	at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.lambda$runMouseReleasedCommand$1(EditorImpl.java:3828)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.runMouseReleasedCommand(EditorImpl.java:3830)
	at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.mouseReleased(EditorImpl.java:3719)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
	at java.awt.Component.processMouseEvent(Component.java:6550)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
	at java.awt.Component.processEvent(Component.java:6315)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4899)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4721)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4721)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:766)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:739)
	at java.awt.EventQueue$4.run(EventQueue.java:737)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:736)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:757)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:702)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:375)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Let's not show the Marker if the post() doesn't have any parameter.
Also we need to handle the error, and add a log (in case something else throws this)

Improve UX

Improve the PopUp Table UX.
Probably try bold or italics for the LineNumber, etc...

Enable Speed Search

Enable Speed Search for the containing class names for faster navigation.

Plugin does't load in 2022.1

Throws an error message: "not compatible with the current version of the IDE, because it requires build 213.* or older"

Would be great if you had the time to look into it. Cheers!

Add logs

Currently there are no logs and hence no way to troubleshoot issues, when users report them. An even important reason is we do all our tests against intellij community edition, but our major ide is Android Studio. So the only way to fix errors in AS is by using the logs.

Super types and Sub types

Different cases:

  1. Post(subType) -> Subscribe(superType)
  2. Post(getSuperType()) -> Subscribe(subType) {where getSuperType() returns superType, but the concrete implementation returned is subType}

In the first case, we need to ensure both Post and Subscribe connection works.
In the second case, if a superType is posted, then we need to showUsages of all the subTypes involved in the Subscribe, because any of those methods can be called based on the runtime value. Since we can't guess the runtime value, this is what we can do. We just need to show all the possibilities.

with(EventBus) { post() } - Marker not shown

with(EventBus.getDefault()) {
            post(KotlinType())
            postSticky(KotlinType())
        }

Show marker in this case.

Possible solution: Check for the receiver type via (uElement as UCallExpression).receiverType

@file:JvmName doesn't work

When a kotlin file is named for java interop like below:
@file:JvmName("KotlinMain")

The file name doesn't show up in the usages PopUp (for top level functions)

Sort the Usages

Sort the usages based on ContainingClass and then by LineNumber.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.