-
Notifications
You must be signed in to change notification settings - Fork 22
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
Checking of imported contract failed if not specified for deployment #319
Comments
@aacoimbra thanks for reporting this, but this is by design, we intentionally check only the contracts you have in the deployments section, because there might be different contracts deployed for different networks. |
@sideninja Actually I’m not using the extension to deploy contracts or send transactions, I’m doing this using the fcl. |
To be clear, in this case I want to run the emulator with only default contracts, and deploy all my contracts and run transactions with fcl, to simulate exactly how it will be in production. But if I don't specify the contracts for deployment in flow.json, the intellisense features of the extenseion won't work for any contract or transactions I'm creating. |
@aacoimbra Unfortunately that's how we know what is that you are importing. Unless you use file path location to the contract, which I don't advise, we can't know which contract your import references unless you specify that in configuration flow.json. There are tools that do that for you like |
Also note that if you use |
However, the IntelliSense for contracts you defined an alias for (like the FlowToken above) should work without adding them to the deployments section. But you must make sure that contract was actually deployed. |
This should be solved by onflow/cadence-tools#224 (pending a new release of the language server and Flow CLI) |
Problem
Extension raises error when importing a contract that is not manually deployed but instead automatically deployed in the emulator such as the FlowToken contract.
Given the following flow.json file, importing
NonFungibleToken
will work, but importingFlowToken
will not.This behavior also occurs for other automatically deployed contracts.
Steps to Reproduce
Copy flow.json above and create the folder strucure complying with "./cadence/contracts/NonFungibleToken.cdc" and paste the contracts.
Attempt to import
FlowToken
in a .cdc file.Workaround
Making the following change to flow.json will avoid raising an error when importing, but will unnecessarily deploy the contract to
emulator-account
.This issue can be reliably reproduced.
Extension version v1.2.0.
OS: Windows 11
The text was updated successfully, but these errors were encountered: