You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 properlypubcontractA {}
B.cdc
import C from"../foo/C.cdc"pubcontractB {}
C.cdc
pubcontractC {}
Environment
- LS version: v0.32.0
- Network: n/a
The text was updated successfully, but these errors were encountered:
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
changed the title
[LS] Cannot use identifier imports & path imports together
[LS] Cannot use new import syntax & path imports together
Oct 24, 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
B.cdc
C.cdc
Environment
The text was updated successfully, but these errors were encountered: