Skip to content

is Table Literal type support multiple line ? #1436

Answered by carsakiller
xiangnanscu asked this question in Q&A
Discussion options

You must be logged in to vote

If you are accepting the options as a table, I recommend using @class

---@class Options
---@field page number
---@field active boolean


---@param opts Options
local function acceptOptions(opts) end

acceptOptions({
	page = 1,
	active = false
})

Note: to receive completions when providing options when calling acceptOptions(), you will have to press CTRL + Space as it will not automatically suggest completions.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@xiangnanscu
Comment options

@xiangnanscu
Comment options

Comment options

You must be logged in to vote
5 replies
@xiangnanscu
Comment options

@carsakiller
Comment options

@xiangnanscu
Comment options

@xiangnanscu
Comment options

@sumneko
Comment options

Answer selected by xiangnanscu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants