sway icon indicating copy to clipboard operation
sway copied to clipboard

Support individual element spans for tuples and arrays in `TypedStructFields`

Open JoshuaBatty opened this issue 3 years ago • 0 comments

I'm currently adding in support for collecting the fields from Struct and Storage Declarations in the language server. I have everything working apart from arrays and tuples.

The image below demonstrates the fields that we can and can't currently collect. I'm drawing squiggly error lines under the tokens which demonstrates the span information accessible from the compiler.

Screen Shot 2022-08-09 at 9 49 28 am

Currently, the Span for an array is "[u64, 3]" whereas we need to have 2 unique spans. One for "u64" and one for "3".

Similarly with tuples. we need unique spans for the individual elements. At the moment the compiler just has spans for each element in the outer tuple. We also require unique span information for inner tuples and arrays within a tuple.

JoshuaBatty avatar Aug 08 '22 23:08 JoshuaBatty