DanielGavin / ols

Language server for Odin
MIT License
375 stars 56 forks source link

Add support for `raw_data` macro #417

Closed thetarnav closed 3 days ago

thetarnav commented 5 days ago

The raw_data macro is too complicated to be added to builtin.odin probably. So it needs to be hard coded, but it would be nice to have a autocomplete and hover information about it and the returned types. in odin code its something like this:

raw_data_string  :: proc (v: string)         -> [^]u8                           ---
raw_data_slice   :: proc (v: $T/[]$E)        -> [^]E                            ---
raw_data_dynamic :: proc (v: $T/[dynamic]$E) -> [^]E                            ---
raw_data_array   :: proc (v: ^$T)            -> [^]intrinsics.type_elem_type(T) ---
thetarnav commented 5 days ago

actually nevermind I think it can be added to builtin will try to do that

thetarnav commented 5 days ago

nope https://github.com/odin-lang/Odin/pull/3835

DanielGavin commented 5 days ago

He might not want the procedures you made, but we still need completion for it. I agree if the procedures we make don't reflect what happens in the compiler, it's a problem.

Yeah it might not be possible to reflect everything without hardcoding it, but maybe it's good enough for now.

thetarnav commented 5 days ago

right I guess I could still add it to ols’s builtin file, since it’s just for completions. I’ll see how that works