hardhat-vscode icon indicating copy to clipboard operation
hardhat-vscode copied to clipboard

Go to definition doesn't work for inherited methods

Open fvictorio opened this issue 2 years ago • 1 comments
trafficstars

Given this code:

contract Foo {
  function f() public {}
}

contract Foo2 is Foo {
}

contract Bar {
  function f(Foo2 foo) public {
    foo.f();
  }
}

If you try to go to the definition of f in foo.f(), you'll get a "No definition found for 'f'" message.

Other things do work though. For example, navigation works if you remove the indirection:

contract Bar {
  function f(Foo foo) public {
    foo.f();
  }
}

or if you use a method in the inherited contract:

contract Foo2 is Foo {
  function g() public {
  }
}

contract Bar {
  function f(Foo2 foo) public {
    foo.g();
  }
}

fvictorio avatar Dec 05 '22 09:12 fvictorio

I have the same issue.

logan272 avatar Mar 29 '24 01:03 logan272