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

Cannot go to definition of struct when using a named import

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

// Foo.sol
import { MyStruct } from "./Bar.sol";

// Bar.sol
struct MyStruct {
  uint x;
}

Ctrl+clicking MyStruct in the import doesn't take you to the definition.

This doesn't work either if you ctrl+click and usage of the struct:

contract Foo {
    MyStruct myStruct;
}

On the other hand, in this example it does work:

import "./Bar.sol";

contract Foo {
  MyStruct myStruct;
}

So it seems to be related to using a named import.

Also, going to the definition of a contract that is name-imported works. It's just structs that don't.

fvictorio avatar Dec 15 '22 17:12 fvictorio