chunk
comment
-- "--"
comment_content " This module contains the Screen class, a complete Nvim UI i"...
comment
-- "--"
comment_content " designed for functional testing (verifying screen state, in"...
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " Screen:expect() takes a string representing the expected sc"...
comment
-- "--"
comment_content " optional set of attribute identifiers for checking highligh"...
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " Example usage:"
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " -- Attach a screen to the current Nvim instance."
comment
-- "--"
comment_content " local screen = Screen.new(25, 10)"
comment
-- "--"
comment_content " -- Enter insert-mode and type some text."
comment
-- "--"
comment_content " feed('ihello screen')"
comment
-- "--"
comment_content " -- Assert the expected screen state."
comment
-- "--"
comment_content " screen:expect([["
comment
-- "--"
comment_content " hello screen^ |"
comment
-- "--"
comment_content " {1:~ }|*8"
comment
-- "--"
comment_content " {5:-- INSERT --} |"
comment
-- "--"
comment_content " ]]) -- <- Last line is stripped"
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " Since screen updates are received asynchronously, expect() "...
comment
-- "--"
comment_content " the _eventual_ screen state."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " This is how expect() works:"
comment
-- "--"
comment_content " * It starts the event loop with a timeout."
comment
-- "--"
comment_content " * Each time it receives an update it checks that against t"...
comment
-- "--"
comment_content " * If the expected state matches the current state, the e"...
comment
-- "--"
comment_content " stopped and expect() will return."
comment
-- "--"
comment_content " * If the timeout expires, the last match error will be r"...
comment
-- "--"
comment_content " test will fail."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " The 30 most common highlight groups are predefined, see ini"...
comment
-- "--"
comment_content " In this case \"5\" is a predefined highlight associated with "...
comment
-- "--"
comment_content " attribute: bold. Note that since the {5:} markup is not a r"...
comment
-- "--"
comment_content " screen, the delimiter \"|\" moved to the right. Also, the hig"...
comment
-- "--"
comment_content " NonText markers \"~\" is visible."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " Tests will often share a group of extra attribute sets to e"...
comment
-- "--"
comment_content " defined at the beginning of a test:"
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " screen:add_extra_attr_ids({"
comment
-- "--"
comment_content " [100] = { background = Screen.colors.Plum1, underline "...
comment
-- "--"
comment_content " [101] = { background = Screen.colors.Red1, bold = true"...
comment
-- "--"
comment_content " })"
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " To help write screen tests, see Screen:snapshot_util()."
comment
-- "--"
comment_content " To debug screen tests, see Screen:redraw_debug()."
variable_declaration
local "local"
assignment_statement
variable_list
identifier "t"
= "="
expression_list
function_call
identifier "require"
arguments
( "("
string
' "'"
string_content "test.testutil"
' "'"
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "n"
= "="
expression_list
function_call
function_call
identifier "require"
arguments
( "("
string
' "'"
string_content "test.functional.testnvim"
' "'"
) ")"
arguments
( "("
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "busted"
= "="
expression_list
function_call
identifier "require"
arguments
( "("
string
' "'"
string_content "busted"
' "'"
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "uv"
= "="
expression_list
dot_index_expression
identifier "vim"
. "."
identifier "uv"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "deepcopy"
= "="
expression_list
dot_index_expression
identifier "vim"
. "."
identifier "deepcopy"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "shallowcopy"
= "="
expression_list
dot_index_expression
identifier "t"
. "."
identifier "shallowcopy"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "concat_tables"
= "="
expression_list
dot_index_expression
identifier "t"
. "."
identifier "concat_tables"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "pesc"
= "="
expression_list
dot_index_expression
identifier "vim"
. "."
identifier "pesc"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "run_session"
= "="
expression_list
dot_index_expression
identifier "n"
. "."
identifier "run_session"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "eq"
= "="
expression_list
dot_index_expression
identifier "t"
. "."
identifier "eq"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "dedent"
= "="
expression_list
dot_index_expression
identifier "t"
. "."
identifier "dedent"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "get_session"
= "="
expression_list
dot_index_expression
identifier "n"
. "."
identifier "get_session"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "create_callindex"
= "="
expression_list
dot_index_expression
identifier "n"
. "."
identifier "create_callindex"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "inspect"
= "="
expression_list
dot_index_expression
identifier "vim"
. "."
identifier "inspect"
function_declaration (+36 nodes collapsed)
comment
-- "--"
comment_content "- @class test.functional.ui.screen.Grid"
comment
-- "--"
comment_content "- @field rows table[][]"
comment
-- "--"
comment_content "- @field width integer"
comment
-- "--"
comment_content "- @field height integer"
comment
-- "--"
comment_content "- @class test.functional.ui.screen"
comment
-- "--"
comment_content "- @field colors table<string,integer>"
comment
-- "--"
comment_content "- @field colornames table<integer,string>"
comment
-- "--"
comment_content "- @field uimeths table<string,function>"
comment
-- "--"
comment_content "- @field options? table<string,any>"
comment
-- "--"
comment_content "- @field timeout integer"
comment
-- "--"
comment_content "- @field win_position table<integer,table<string,integer>>"
comment
-- "--"
comment_content "- @field float_pos table<integer,table>"
comment
-- "--"
comment_content "- @field cmdline table<integer,table>"
comment
-- "--"
comment_content "- @field cmdline_hide_level integer?"
comment
-- "--"
comment_content "- @field cmdline_block table[]"
comment
-- "--"
comment_content "- @field hl_groups table<string,integer> Highlight group to "...
comment
-- "--"
comment_content "- @field hl_names table<integer,string> Highlight ID to grou"...
comment
-- "--"
comment_content "- @field messages table<integer,table>"
comment
-- "--"
comment_content "- @field private _cursor {grid:integer,row:integer,col:integ"...
comment
-- "--"
comment_content "- @field private _grids table<integer,test.functional.ui.scr"...
comment
-- "--"
comment_content "- @field private _grid_win_extmarks table<integer,table>"
comment
-- "--"
comment_content "- @field private _attr_table table<integer,table>"
comment
-- "--"
comment_content "- @field private _hl_info table<integer,table>"
comment
-- "--"
comment_content "- @field private _stdout uv.uv_pipe_t?"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "Screen"
= "="
expression_list
table_constructor
{ "{"
} "}"
assignment_statement
variable_list
dot_index_expression
identifier "Screen"
. "."
identifier "__index"
= "="
expression_list
identifier "Screen"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "default_timeout_factor"
= "="
expression_list
number "1"
if_statement (+26 nodes collapsed)
if_statement (+26 nodes collapsed)
variable_declaration
local "local"
assignment_statement
variable_list
identifier "default_screen_timeout"
= "="
expression_list
binary_expression
identifier "default_timeout_factor"
* "*"
number "3500"
function_declaration (+903 nodes collapsed)
comment
-- "--"
comment_content "- @class test.functional.ui.screen.Opts"
comment
-- "--"
comment_content "- @field ext_linegrid? boolean"
comment
-- "--"
comment_content "- @field ext_multigrid? boolean"
comment
-- "--"
comment_content "- @field ext_newgrid? boolean"
comment
-- "--"
comment_content "- @field ext_popupmenu? boolean"
comment
-- "--"
comment_content "- @field ext_wildmenu? boolean"
comment
-- "--"
comment_content "- @field rgb? boolean"
comment
-- "--"
comment_content "- @field _debug_float? boolean"
comment
-- "--"
comment_content "- @param width? integer"
comment
-- "--"
comment_content "- @param height? integer"
comment
-- "--"
comment_content "- @param options? test.functional.ui.screen.Opts"
comment
-- "--"
comment_content "- @param session? test.Session|false"
comment
-- "--"
comment_content "- @return test.functional.ui.screen"
function_declaration (+542 nodes collapsed)
function_declaration (+30 nodes collapsed)
function_declaration (+100 nodes collapsed)
function_declaration (+21 nodes collapsed)
comment
-- "--"
comment_content "- @param fd number"
function_declaration (+45 nodes collapsed)
comment
-- "--"
comment_content "- @param session? test.Session"
function_declaration (+220 nodes collapsed)
function_declaration (+31 nodes collapsed)
function_declaration (+46 nodes collapsed)
function_declaration (+32 nodes collapsed)
comment
-- "--"
comment_content "- @param option 'ext_linegrid'|'ext_multigrid'|'ext_popupmen"...
comment
-- "--"
comment_content "- @param value boolean"
function_declaration (+44 nodes collapsed)
comment
-- "--"
comment_content " canonical order of ext keys, used to generate asserts"
variable_declaration (+94 nodes collapsed)
variable_declaration (+85 nodes collapsed)
for_statement (+28 nodes collapsed)
comment
-- "--"
comment_content "- @class test.functional.ui.screen.Expect"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Expected screen state (string). Each line represents a scr"...
comment
-- "--"
comment_content "- row. Last character of each row (typically \"|\") is strippe"...
comment
-- "--"
comment_content "- Common indentation is stripped."
comment
-- "--"
comment_content "- \"{MATCH:x}\" in a line is matched against Lua pattern `x`."
comment
-- "--"
comment_content "- \"*n\" at the end of a line means it repeats `n` times."
comment
-- "--"
comment_content "- @field grid? string"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Expected text attributes. Screen rows are transformed acco"...
comment
-- "--"
comment_content "- to this table, as follows: each substring S composed of"
comment
-- "--"
comment_content "- characters having the same attributes will be substituted "...
comment
-- "--"
comment_content "- \"{K:S}\", where K is a key in `attr_ids`. Any unexpected"
comment
-- "--"
comment_content "- attributes in the final state are an error."
comment
-- "--"
comment_content "- Use an empty table for a text-only (no attributes) expecta"...
comment
-- "--"
comment_content "- Use screen:set_default_attr_ids() to define attributes for"...
comment
-- "--"
comment_content "- expect() calls."
comment
-- "--"
comment_content "- @field attr_ids? table<integer,table<string,any>>"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Expected win_extmarks accumulated for the grids. For each "...
comment
-- "--"
comment_content "- the win_extmark messages are accumulated into an array."
comment
-- "--"
comment_content "- @field extmarks? table<integer,table>"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Function asserting some arbitrary condition. Return value "...
comment
-- "--"
comment_content "- ignored, throw an error (use eq() or similar) to signal fa"...
comment
-- "--"
comment_content "- @field condition? fun()"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Lua pattern string expected to match a screen line. NB: th"...
comment
-- "--"
comment_content "- following chars are magic characters"
comment
-- "--"
comment_content "- ( ) . % + - * ? [ ^ $"
comment
-- "--"
comment_content "- and must be escaped with a preceding % for a literal match"...
comment
-- "--"
comment_content "- @field any? string|table<string>"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Lua pattern string expected to not match a screen line. NB"...
comment
-- "--"
comment_content "- following chars are magic characters"
comment
-- "--"
comment_content "- ( ) . % + - * ? [ ^ $"
comment
-- "--"
comment_content "- and must be escaped with a preceding % for a literal match"...
comment
-- "--"
comment_content "- @field none? string|table<string>"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Expected mode as signaled by \"mode_change\" event"
comment
-- "--"
comment_content "- @field mode? string"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Test that the screen state is unchanged since the previous"
comment
-- "--"
comment_content "- expect(...). Any flush event resulting in a different stat"...
comment
-- "--"
comment_content "- considered an error. Not observing any events until timeou"...
comment
-- "--"
comment_content "- is acceptable."
comment
-- "--"
comment_content "- @field unchanged? boolean"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Test that the final state is the same as the previous expe"...
comment
-- "--"
comment_content "- but expect an intermediate state that is different. If pos"...
comment
-- "--"
comment_content "- it is better to use an explicit screen:expect(...) for thi"...
comment
-- "--"
comment_content "- intermediate state."
comment
-- "--"
comment_content "- @field intermediate? boolean"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Reset the state internal to the test Screen before startin"...
comment
-- "--"
comment_content "- receive updates. This should be used after command(\"redraw"...
comment
-- "--"
comment_content "- or some other mechanism that will invoke \"redraw!\", to che"...
comment
-- "--"
comment_content "- that all screen state is transmitted again. This includes"
comment
-- "--"
comment_content "- state related to ext_ features as mentioned below."
comment
-- "--"
comment_content "- @field reset? boolean"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- maximum time that will be waited until the expected state "...
comment
-- "--"
comment_content "- seen (or maximum time to observe an incorrect change when"
comment
-- "--"
comment_content "- `unchanged` flag is used)"
comment
-- "--"
comment_content "- @field timeout? integer"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- @field mouse_enabled? boolean"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- @field win_viewport? table<integer,table<string,integer>>"
comment
-- "--"
comment_content "- @field win_viewport_margins? table<integer,table<string,in"...
comment
-- "--"
comment_content "- @field win_pos? table<integer,table<string,integer>>"
comment
-- "--"
comment_content "- @field float_pos? [integer,integer]"
comment
-- "--"
comment_content "- @field hl_groups? table<string,integer>"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- The following keys should be used to expect the state of v"...
comment
-- "--"
comment_content "- features. Note that an absent key will assert that the ite"...
comment
-- "--"
comment_content "- NOT present on the screen, also when positional form is us"...
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Expected ext_popupmenu state,"
comment
-- "--"
comment_content "- @field popupmenu? table"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Expected ext_cmdline state, as an array of cmdlines of"
comment
-- "--"
comment_content "- different level."
comment
-- "--"
comment_content "- @field cmdline? table"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Expected ext_cmdline block (for function definitions)"
comment
-- "--"
comment_content "- @field cmdline_block? table"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- items for ext_wildmenu"
comment
-- "--"
comment_content "- @field wildmenu_items? table"
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- position for ext_wildmenu"
comment
-- "--"
comment_content "- @field wildmenu_pos? table"
comment
-- "--"
comment_content "- Asserts that the screen state eventually matches an expect"...
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- Can be called with positional args:"
comment
-- "--"
comment_content "- screen:expect(grid, [attr_ids])"
comment
-- "--"
comment_content "- screen:expect(condition)"
comment
-- "--"
comment_content "- or keyword args (supports more options):"
comment
-- "--"
comment_content "- screen:expect({ grid=[[...]], cmdline={...}, condition="...
comment
-- "--"
comment_content "-"
comment
-- "--"
comment_content "- @param expected string|function|test.functional.ui.screen."...
comment
-- "--"
comment_content "- @param attr_ids? table<integer,table<string,any>>"
function_declaration (+2237 nodes collapsed)
function_declaration (+80 nodes collapsed)
comment
-- "--"
comment_content "- @private"
comment
-- "--"
comment_content "- @param check fun(): string"
comment
-- "--"
comment_content "- @param flags table<string,any>"
function_declaration (+857 nodes collapsed)
function_declaration (+64 nodes collapsed)
comment
-- "--"
comment_content "- @private"
comment
-- "--"
comment_content "- @param updates {[1]:string, [integer]:any[]}[]"
function_declaration (+220 nodes collapsed)
function_declaration (+74 nodes collapsed)
function_declaration (+32 nodes collapsed)
function_declaration (+278 nodes collapsed)
function_declaration (+76 nodes collapsed)
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_flush"
parameters
( "("
) ")"
end "end"
function_declaration (+122 nodes collapsed)
comment
-- "--"
comment_content "- @param cursor_style_enabled boolean"
comment
-- "--"
comment_content "- @param mode_info table[]"
function_declaration (+173 nodes collapsed)
function_declaration (+88 nodes collapsed)
function_declaration (+56 nodes collapsed)
function_declaration (+76 nodes collapsed)
function_declaration (+61 nodes collapsed)
function_declaration (+44 nodes collapsed)
function_declaration (+73 nodes collapsed)
function_declaration (+75 nodes collapsed)
function_declaration (+113 nodes collapsed)
function_declaration (+62 nodes collapsed)
function_declaration (+44 nodes collapsed)
function_declaration (+44 nodes collapsed)
function_declaration (+38 nodes collapsed)
function_declaration (+25 nodes collapsed)
function_declaration (+67 nodes collapsed)
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_busy_start"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "_busy"
= "="
expression_list
true "true"
end "end"
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_busy_stop"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "_busy"
= "="
expression_list
false "false"
end "end"
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_mouse_on"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "mouse_enabled"
= "="
expression_list
true "true"
end "end"
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_mouse_off"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "mouse_enabled"
= "="
expression_list
false "false"
end "end"
function_declaration (+45 nodes collapsed)
function_declaration (+78 nodes collapsed)
function_declaration (+95 nodes collapsed)
comment
-- "--"
comment_content "- @param g any"
comment
-- "--"
comment_content "- @param top integer"
comment
-- "--"
comment_content "- @param bot integer"
comment
-- "--"
comment_content "- @param left integer"
comment
-- "--"
comment_content "- @param right integer"
comment
-- "--"
comment_content "- @param rows integer"
comment
-- "--"
comment_content "- @param cols integer"
function_declaration (+292 nodes collapsed)
function_declaration (+60 nodes collapsed)
comment
-- "--"
comment_content "- @param name string"
comment
-- "--"
comment_content "- @param id integer"
function_declaration (+27 nodes collapsed)
function_declaration (+43 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+113 nodes collapsed)
comment
-- "--"
comment_content "- @param grid integer"
comment
-- "--"
comment_content "- @param row integer"
comment
-- "--"
comment_content "- @param col integer"
comment
-- "--"
comment_content "- @param items integer[][]"
function_declaration (+213 nodes collapsed)
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_bell"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "bell"
= "="
expression_list
true "true"
end "end"
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_visual_bell"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "visual_bell"
= "="
expression_list
true "true"
end "end"
function_declaration (+56 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_suspend"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "suspended"
= "="
expression_list
true "true"
end "end"
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_update_menu"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "update_menu"
= "="
expression_list
true "true"
end "end"
function_declaration (+21 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+27 nodes collapsed)
function_declaration (+40 nodes collapsed)
function_declaration (+55 nodes collapsed)
function_declaration (+24 nodes collapsed)
function_declaration
function "function"
method_index_expression
identifier "Screen"
: ":"
identifier "_handle_popupmenu_hide"
parameters
( "("
) ")"
block
assignment_statement
variable_list
dot_index_expression
identifier "self"
. "."
identifier "popupmenu"
= "="
expression_list
nil "nil"
end "end"
function_declaration (+177 nodes collapsed)
function_declaration (+48 nodes collapsed)
function_declaration (+42 nodes collapsed)
function_declaration (+30 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+33 nodes collapsed)
function_declaration (+22 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+27 nodes collapsed)
function_declaration (+105 nodes collapsed)
function_declaration (+22 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+21 nodes collapsed)
function_declaration (+30 nodes collapsed)
function_declaration (+33 nodes collapsed)
function_declaration (+46 nodes collapsed)
function_declaration (+103 nodes collapsed)
function_declaration (+564 nodes collapsed)
function_declaration (+82 nodes collapsed)
function_declaration (+639 nodes collapsed)
function_declaration (+172 nodes collapsed)
comment
-- "--"
comment_content " Generates tests. Call it where Screen:expect() would be. Wa"...
comment
-- "--"
comment_content " dumps the current screen state in the form of Screen:expect"...
comment
-- "--"
comment_content " Use snapshot_util({}) to generate a text-only (no attribute"...
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " @see Screen:redraw_debug()"
function_declaration (+34 nodes collapsed)
function_declaration (+145 nodes collapsed)
comment
-- "--"
comment_content "- @param headers boolean"
comment
-- "--"
comment_content "- @param attr_state any"
comment
-- "--"
comment_content "- @param preview? boolean"
comment
-- "--"
comment_content "- @return string[]"
function_declaration (+314 nodes collapsed)
comment
-- "--"
comment_content " Returns the current screen state in the form of a screen:ex"...
comment
-- "--"
comment_content " keyword-args map."
function_declaration (+462 nodes collapsed)
function_declaration
local "local"
function "function"
identifier "fmt_ext_state"
parameters
( "("
identifier "name"
, ","
identifier "state"
) ")"
block
function_declaration (+34 nodes collapsed)
if_statement
if "if"
binary_expression
identifier "name"
== "=="
string
' "'"
string_content "win_viewport"
' "'"
then "then"
block (+150 nodes collapsed)
elseif_statement
elseif "elseif"
binary_expression
identifier "name"
== "=="
string
' "'"
string_content "float_pos"
' "'"
then "then"
block
variable_declaration
local "local"
assignment_statement
variable_list
identifier "str"
= "="
expression_list
string
' "'"
string_content
escape_sequence "\\n"
' "'"
for_statement
for "for"
for_generic_clause
variable_list
identifier "k"
, ","
identifier "v"
in "in"
expression_list
function_call
identifier "pairs"
arguments
( "("
identifier "state"
) ")"
do "do"
block
assignment_statement
variable_list
identifier "str"
= "="
expression_list
binary_expression
identifier "str"
.. ".."
binary_expression
string
' "'"
string_content " ["
' "'"
.. ".."
binary_expression
identifier "k"
.. ".."
binary_expression
string
' "'"
string_content "] = {"
' "'"
.. ".."
bracket_index_expression
identifier "v"
[ "["
number "1"
] "]"
for_statement (+37 nodes collapsed)
assignment_statement
variable_list
identifier "str"
= "="
expression_list
binary_expression
identifier "str"
.. ".."
string
' "'"
string_content
escape_sequence "\\n"
' "'"
end "end"
return_statement
return "return"
expression_list
binary_expression
identifier "str"
.. ".."
string
' "'"
string_content "}"
' "'"
else_statement (+23 nodes collapsed)
end "end"
end "end"
function_declaration (+574 nodes collapsed)
function_declaration (+49 nodes collapsed)
function_declaration (+352 nodes collapsed)
function_declaration (+448 nodes collapsed)
function_declaration (+272 nodes collapsed)
function_declaration (+176 nodes collapsed)
function_declaration (+195 nodes collapsed)
comment
-- "--"
comment_content "-@diagnostic disable-next-line: unused-local, unused-functio"...
function_declaration (+62 nodes collapsed)
function_declaration (+301 nodes collapsed)
function_declaration (+116 nodes collapsed)
function_declaration (+219 nodes collapsed)
function_declaration (+51 nodes collapsed)
function_declaration (+68 nodes collapsed)
return_statement
return "return"
expression_list
identifier "Screen"