Skip to content

How to document @field values (description not shown when hovering the function) #3373

Description

@ChillerDragon
Image
---@class Foo
---
---desc1
---@field dostuff fun(param1: integer) # desc2
foo = {}


function foo.dostuff(param1)
	print(param1)
end

I have an api defined in my meta file with functions the user can define. According to the documentation https://luals.github.io/wiki/annotations/#field

The syntax is this one: ---@field [scope] <name[?]> <type> [description]
A bit sad that the description has to come after the field and can not be above it. If the type is already a long callback the entire annotation line with long description will be super long :(

Anyways even that one I could not get to work. My editor would not show the description when hovering the function. Also I could not go to its definition to at least manually browse the type annotations.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions