In this example, the language server does not know what type of object is assigned the variable me.
int main(object me) {
return me->query_is_player();
}
We need a way to tell the server that me is, for example, an object (or blueprint) of type /std/living.c. In some cases we may be able to determine this once the type checker is rebuilt to utilize flow nodes. In other situations, type inference may not be possible and we'll need a way to provide a hint.
One possibility is to use an extension of jsdoc. Example:
/**
* Main function
* @param {"/std/living.c"} me The living object (player or mob)
* @returns {int} 1 if the living object a player
*/
Where the type hint {"/std/living.c"} would imply that me is also of type object.
Note: this may only be needed in Fluff and older LD versions. The latest version of LD allows "named" object types.
In this example, the language server does not know what type of object is assigned the variable
me
.We need a way to tell the server that
me
is, for example, an object (or blueprint) of type/std/living.c
. In some cases we may be able to determine this once the type checker is rebuilt to utilize flow nodes. In other situations, type inference may not be possible and we'll need a way to provide a hint.One possibility is to use an extension of jsdoc. Example:
Where the type hint
{"/std/living.c"}
would imply thatme
is also of typeobject
.Note: this may only be needed in Fluff and older LD versions. The latest version of LD allows "named" object types.