Closed Caleb-o closed 2 months ago
@Caleb-o can you provide the full file content where this code is located? I cannot reproduce it in my tests.
I just tried it again. It seems to be in specific cases of nested structures while importing a module:
// Needs to include std::io
import std::io;
struct Foo {
// Needs to be an inner struct or union
struct data {
int print;
}
}
fn void main() {
// ...
}
Ok, anonymous structs inside structs are not being properly indexed, that's why. Will work on parsing it properly.
How do you write/read print
?
Like this?
Foo obj;
obj.data.print = 3;
@Caleb-o , just pushed to main
a fix to better handle these scenarios. In my tests, hover already displays the proper information.
However, autocompletion is not able to find members of that substruct yet. Working on it.
Fixed the autocomplete too.
Ok, anonymous structs inside structs are not being properly indexed, that's why. Will work on parsing it properly.
How do you write/read
Like this?
Foo obj; obj.data.print = 3;
Yeah, that's it
Foo foo = { { 10 } };
foo.data.print = 30;
io::printfn("Print %s", foo.data.print);
This seems to be working now, after pulling the latest changes
I'll close then. Feel free to reopen if you find something still not working.
Describe the bug Field is misidentified as a std lib function, since it has the same name.
Note: Print seems to have a space before
x
in its signature.To Reproduce Steps to reproduce the behavior:
print
Expected behavior Show the field information
Screenshots
Desktop (please complete the following information):