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

[LS] Cannot use new import syntax & path imports together #225

Open
jribbink opened this issue Oct 22, 2023 · 2 comments
Open

[LS] Cannot use new import syntax & path imports together #225

jribbink opened this issue Oct 22, 2023 · 2 comments
Labels
Bug The issue represents a bug, malfunction, regression Feedback

Comments

@jribbink
Copy link
Contributor

jribbink commented Oct 22, 2023

Current Behavior

Due to the design of the LS & how sema.Checker locations are set at runtime, a contract imported using the new import syntax cannot import a contract using relative path imports (aka file imports).

Expected Behavior

You should be able to use relative path imports & new import syntax together.

This is especially important if somebody copy + pastes core contracts into their project. These contracts may import each other and be using the path import syntax -> causes downstream error -> causes confusion.

Steps To Reproduce

A.cdc

import "B"            // will have a diagnostic error in vscode because of imported contract not being able to resolve C.cdc properly
pub contract A {}

B.cdc

import C from "../foo/C.cdc"
pub contract B {}

C.cdc

pub contract C {}

Environment

- LS version: v0.32.0
- Network: n/a
@jribbink jribbink added Bug The issue represents a bug, malfunction, regression Feedback labels Oct 22, 2023
@jribbink jribbink changed the title [LS] Cannot use identifier imports & relative path imports together [LS] Cannot use identifier imports & path imports together Oct 23, 2023
@jribbink jribbink changed the title [LS] Cannot use identifier imports & path imports together [LS] Cannot use new import syntax & path imports together Oct 24, 2023
@bjartek
Copy link

bjartek commented Feb 6, 2024

This hit me today when trying to debug whey imports using a mix of paths and "new import syntax" did not work.

@jribbink jribbink moved this to 🔖 Ready for Pickup in 🌊 Flow 4D Feb 6, 2024
@jribbink
Copy link
Contributor Author

jribbink commented Feb 6, 2024

https://discord.com/channels/613813861610684416/1204034793856180224

cc @gregsantos is this something we should try to prioritize?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue represents a bug, malfunction, regression Feedback
Projects
Status: 🔖 Ready for Pickup
Development

No branches or pull requests

2 participants