Open Chepelau opened 10 months ago
The missing diags in the LSP are an issue - we are looking into it.
About the cairo-compile
call - do note that it runs without the starknet plugin - so all the attributes are ignored, and the LegacyMap
is indeed note known at all.
starknet-compile
is the equivalent you were actually looking for there.
Yes, sorry. Tried with starknet-compile
and it results in the same errors as scarb build
Bug Report
I'm using latest scarb and cairo:
Also using LSP shipped with scarb(which is also the latest version provided by scarb).
Current behavior: When there are some unimported/wrongly named types in Storage used, the LSP does not report that, and pretends it's all alright even if we then use those storage vars in different module. This is problem because if we then try to build the contract it prints tens of errors which are hard debug and determine where they stem from. It might be simple on small contract, but when it contains several files and folders, it might prove quite difficult.
Expected behavior: LSP Should report that the type is missing/unknown.
Example code:
Note the commented type aliases(if they are uncommented, then there is no problem).
First of all, with
cairo-compile
, the error is only one - but it points to LegacyMap:Instead of the unknown types.
With scarb on the other hand it not only prints tens of errors, but some of them might seem kinda cryptic for some newcomer and if the project is large, it is almost impossible to determine what is going:
Other information:
Also here is picture of the code, where LSP clearly doesn't report any bug:![image](https://github.com/starkware-libs/cairo/assets/87245280/3a4a1946-1aa9-4b1f-80ce-ce061f4aeb6a)