SogoCZE / Jails

Jai language server prototype
MIT License
51 stars 9 forks source link

LSP Auto-complete Issues #20

Open ghostbutter-games opened 7 months ago

ghostbutter-games commented 7 months ago

Hi, first of all a big thank you for building this, I very much appreciate the effort and usability that's already there!

I am running into a couple of issues when using VSCode and the LSP with regards to Auto-complete:

Structs

  1. Having a struct instance that’s initialized via the literal syntax .{} breaks the auto-completion. Reproduction:
    
    My_Struct :: struct {
    my_value : int;
    }
    my_struct : My_Struct = .{my_value = 5}; // This breaks auto-complete

my_struct : My_Struct; // For comparison, this works with auto-complete my_struct.my_value = 5;

2. Having a struct with `using` or `#as using` breaks the auto-completion.
Reproduction:
```c++
My_Struct :: struct {
    using other : My_Other_Struct;
    my_value : int;
}

My_Other_Struct :: struct {
    other_value : string;
}
my_struct : My_Struct; 
my_struct.my_value = 5; // This works with auto_complete
my_struct.other_value = "test"; // This does not work with auto-complete for other_value

#import auto-complete

EDIT: It seems like the newest Jai version (0.1.086) fixed the auto-complete of the module I was using again, thankfully. However, I have one quality of life issue:

When importing my Raylib module via rl :: #import "raylib"; and then using rl., the auto-completion list includes everything, including other module's namespaces, like e.g. the Basic module, etc.

It would be great if this could be fixed somehow, as rl.log does not make any sense / does not exist, but is still suggested as a valid auto-completion.

wijiler commented 7 months ago

I can confirm I have had these problems too.

valignatev commented 1 month ago

Instead of creating another autocomplete feature request, I'll just add it here:

Stuff from preload is always in the global scope. But I have to explicitly import it with #import "Preload" to get the autocompletion for things like Type_Info_Struct and friends. And explicitly importing Preload is quite discouraged by the compiler!

SogoCZE commented 1 month ago

Instead of creating another autocomplete feature request, I'll just add it here:

Stuff from preload is always in the global scope. But I have to explicitly import it with #import "Preload" to get the autocompletion for things like Type_Info_Struct and friends. And explicitly importing Preload is quite discouraged by the compiler!

Jails currenty does not include Preload or Runtime_Support by default in its analyzer. I´ve already start to work on this.