is Table Literal type support multiple line ? #1436
Answered
by
carsakiller
xiangnanscu
asked this question in
General Questions
|
I've a function accepting an option table with many fields: Do I need define |
Answered by
carsakiller
Aug 3, 2022
Replies: 2 comments 7 replies
|
A bit confused here since you use foo as both a function name and table name. What are you looking to do? For the table, you'll want a In terms of a function, you want to pass in multiple options, you'll need and have your function process the list using the lookup in the foo table to get the associated value. |
2 replies
|
If you are accepting the options as a table, I recommend using ---@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 |
5 replies
Answer selected by
xiangnanscu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

If you are accepting the options as a table, I recommend using
@classNote: to receive completions when providing options when calling
acceptOptions(), you will have to press CTRL + Space as it will not automatically suggest completions.