Skip to content

[feat] Jump to definition when there are multiple jump points #3093

Description

@abose

Describe the bug

In some cases, there can be multiple jump point resolution on jump to definition. in which case we should ask the user where to jump.

Reproduction

class MyBaseClass {
  sayHello() {
    throw new Error("Method not implemented");
  }
}

class JohnClass extends MyBaseClass {
  sayHello() {
    console.log("Hello, John!");
  }
}

class JaneClass extends MyBaseClass {
  sayHello() {
    console.log("Hello, Jane!");
  }
}

class AliceClass extends MyBaseClass {
  sayHello() {
    console.log("Hello, Alice!");
  }
}

const myArray = [
  new JohnClass(),
  new JaneClass(),
  new AliceClass()
];

for (const obj of myArray) {
  obj.sayHello();
}

now ctrl-click to jump to definition on obj.say|Hello(); where | is the click cursor. See that it only shows one class description but not any parents.

Expected behavior

It should show a list of possible jump targets to jump to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestFeature requests from customers

    Type

    No type

    Projects

    Status
    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions