unloggedio / intellij-java-plugin

IntelliJ plugin with java language support
https://unlogged.io
Apache License 2.0
12 stars 1 forks source link

Inlay hints how up for candidates when it shouldn't #32

Open TheAmg opened 4 weeks ago

TheAmg commented 4 weeks ago

Describe the bug

When running an application with unlogged sdk 0.7.6 and mode = logAnnotatedOnly it is expected that methods that are annotated with @UnloggedMethod or classes annotated with @UnloggedClass will only be logged and yield candidates.

Consider the following class - >

class A {

    @UnloggedMethod(counter = "1")
    public String methodA()
    {
       return methodB();
    }

    public String methodB()
    {
       return valueFromDownstream;
    }
}

Class doesn't have an @UnloggedClass annotation.

Post calling methodA, an inlayHint will be rendered for methodB as well, but on clicking methodB's inlay hint, there is no candidate for it.

This can be recreated here - Project : unlogged-spring-mvc-maven-demo Classname : BookRestService Method: getAll()

Demo: https://drive.google.com/file/d/1G8weMHaWr5v5-uxO7Dle3Jmg92WphEc5/view?usp=sharing

Reproduction steps

  1. Invoke method mentioned above

Expected behavior

For no Inlay hints to be shown for a method with no candidates.

Additional context

No response