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

[feature] CHA-Based Virtual Call Navigation #2311

Open
konata opened this issue Oct 22, 2024 · 0 comments
Open

[feature] CHA-Based Virtual Call Navigation #2311

konata opened this issue Oct 22, 2024 · 0 comments

Comments

@konata
Copy link

konata commented Oct 22, 2024

Describe your idea

Description

Implement a feature for navigating virtual call sites using Class Hierarchy Analysis (CHA) for the following sources:

abstract class Foo {
  abstract fun foo(): String
}

class Foo1 : Foo() {
  override fun foo(): String {
    TODO("Not yet implemented")
  }
}

class Foo2 : Foo() {
  override fun foo(): String {
    TODO("Not yet implemented")
  }
}

fun foobar(foo: Foo) {
    foo.foo() // call site
}

Proposed Behavior

When navigating to the call site foo.foo(), instead of a direct jump to Foo.foo(), display a selection menu that includes:

  • Foo1.foo()
  • Foo2.foo()
  • Foo.foo()

This allows users to choose which implementation they want to navigate to, and the same functionality should apply to interface methods as well.

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

No branches or pull requests

1 participant