VS code Solidity plugin - Auto-complete doesn't work with abstract contracts

:computer: Environment
WIN10 WSL ubuntu
VS Code
Solidity plugin

:memo:Details
The function in ERC20.sol can auto-complete. but the function (_setupRole) in AccessControl.sol cannot auto-complete.

1 Like

1 Like

Hi @Serenity,

Welcome to the community forum :wave:

Thanks for posting here.

I didn’t realize that there was auto-complete in VSCode using OpenZeppelin Contracts. That is very cool. Great job by @juanfranblanco as always I assume.

It looks like the issue is that AccessControl is an abstract contract.

I created an issue for this: https://github.com/juanfranblanco/vscode-solidity/issues/181

I tried this out with the following to confirm that we don’t get autocomplete for imported abstract contracts:

A.sol

// contracts/A.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;


contract A {
    function doA() internal {}
}

B.sol

// contracts/B.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;


abstract contract B {
    function doB() internal {}
}

MyContract.sol

// contracts/MyContract.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

import "./A.sol";
import "./B.sol";


contract MyContract is A, B {
    function doStuff() public {
       d...
    }
}
1 Like