Skip to content
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

Extension produces inline import error when using root-relative-paths #441

Open
Keinberger opened this issue Jan 14, 2024 · 1 comment
Open

Comments

@Keinberger
Copy link

Problem statement

I unfortunately have an issue trying trying to use the extension on Foundry projects using root-relative-paths. The extension seems to not process these paths correctly and produces an inline error statement.

This is one of the contracts of the project that I'm facing problems with:

This contract can be found in the Sablier-v2 repository: https://github.com/sablier-labs/v2-core/blob/main/test/unit/concrete/adminable/transfer-admin/transferAdmin.t.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19 <0.9.0;

import { Errors } from "src/libraries/Errors.sol";

import { Adminable_Unit_Shared_Test } from "../../../shared/Adminable.t.sol";

contract TransferAdmin_Unit_Concrete_Test is Adminable_Unit_Shared_Test {
    /// ...code of the contract
}

This contract is located inside of the test/unit/concrete/adminable/transferAdmin.t.sol file. As you can see, this file uses the root-relative-path "src/libraries/Errors.sol".

Failure

Unfortunately this path does not get resolved correctly from the VSCode extension and the following in-line error at the line of the import statemens:

Source "src/libraries/Errors.sol" not found: File import callback not supported(6275)

Does anyone have experience with root-relative-path in regards to the Solidity extension or any possible solutions off the top of their head? Any help is much appreciated🙏

@Keinberger Keinberger changed the title Extension produces inline import error when using root-relative-paths Extension produces inline import error when using root-relative import paths Jan 14, 2024
@Keinberger Keinberger changed the title Extension produces inline import error when using root-relative import paths Extension produces inline import error when using root-relative-paths Jan 14, 2024
@juanfranblanco
Copy link
Owner

juanfranblanco commented Feb 13, 2024

@Keinberger you need to set "./" in front of "src" as it will be confused with a library, and yes it has to be relative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants