bug: LSP doesn't check types in Storage #3939
Labels
bug
Something isn't working
help wanted
Extra attention is needed
ide
This issue refers to CairoLS or editor extensions
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:
The text was updated successfully, but these errors were encountered: