You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i use multiple files, one file defines something that is marked as @(private="file") and it uses it freely and intellisense works fine. But this type is totally not visible from other file by the intellisense even if its a valid Odin code, e.g. the first file defines some public identifier that has a "hidden" type, so when we get an instance from any file we should be able to see the fields of that type. Basically the intention is to hide the type itself to do not pollute global scope because there is no need to create instances of that type outside the file, but existing instances (which are created by that file) should be visible to instellisense, as Odin allows it without issues.
The following example demonstrates it:
// data.odin --------------------@(private="file")
Entry :: struct {
name: string,
value: int,
}
data_entries := [] Entry {
{ name="entry 41", value=51 },
{ name="entry 42", value=52 },
{ name="entry 43", value=53 },
}
// main.odin ---------------------
get_entry_name :: proc (idx: int) -> string {
return data_entries[idx].name /* no help with fields when we type "." */
}
main :: proc () {
fmt.println(get_entry_name(1)) // prints "entry 42"
}
Intellisense will not help there until we remove @(private="file") from Entry definition. Please note, the code compiles and works as expected.
The text was updated successfully, but these errors were encountered:
When i use multiple files, one file defines something that is marked as
@(private="file")
and it uses it freely and intellisense works fine. But this type is totally not visible from other file by the intellisense even if its a valid Odin code, e.g. the first file defines some public identifier that has a "hidden" type, so when we get an instance from any file we should be able to see the fields of that type. Basically the intention is to hide the type itself to do not pollute global scope because there is no need to create instances of that type outside the file, but existing instances (which are created by that file) should be visible to instellisense, as Odin allows it without issues.The following example demonstrates it:
Intellisense will not help there until we remove
@(private="file")
from Entry definition. Please note, the code compiles and works as expected.The text was updated successfully, but these errors were encountered: