is Table Literal type support multiple line ? #1436
-
I've a function accepting an option table with many fields:
Do I need define
|
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
If you are accepting the options as a table, I recommend using
@class
Note: to receive completions when providing options when calling
acceptOptions()
, you will have to press CTRL + Space as it will not automatically suggest completions.