Skip to content

Add missing hints for Lua #438

Description

@Sygmei

Values hints

Use this emmylua feature : https://emmylua.github.io/annotations/string_literal_type.html to provide hints where possible (enums are a good candidate)

Also see https://github.com/sumneko/lua-language-server/wiki/Annotations#param (section "Custom Type Parameter") for a good example

For example, for functions taking a obe.transform.Units parameter, we could provide this following hint :

--- Return an UnitVector with the converted values (x, y) to the Unit you want.
---
---@param p_unit obe.transform.Units | obe.transform.Units.ViewPercentage | obe.transform.Units.ScenePixels #An enum value from Transform::Units
---@return obe.transform.UnitVector
function obe.transform._UnitVector:to(p_unit) end

Operator overload hints

See https://github.com/sumneko/lua-language-server/wiki/Annotations#operator for more details

All tasks descrived above should be implemented in Obidog

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureThe issue is about a new incoming / requested feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions