refactor(lua): reformat with stylua 0.14.0 (#19264)

* reformat Lua runtime to make lint CI pass
* reduce max line length to 100
This commit is contained in:
Christian Clason
2022-07-07 18:27:18 +02:00
committed by GitHub
parent 34d41baf8a
commit aa4f9c5341
26 changed files with 563 additions and 182 deletions

View File

@@ -26,7 +26,9 @@ function M.check()
report_error(string.format('Impossible to load parser for %s: %s', parsername, ret))
elseif ret then
local lang = ts.language.inspect_language(parsername)
report_ok(string.format('Loaded parser for %s: ABI version %d', parsername, lang._abi_version))
report_ok(
string.format('Loaded parser for %s: ABI version %d', parsername, lang._abi_version)
)
else
report_error(string.format('Unable to load parser for %s', parsername))
end

View File

@@ -280,7 +280,8 @@ local function on_line_impl(self, buf, line)
end
if state.iter == nil or state.next_row < line then
state.iter = highlighter_query:query():iter_captures(root_node, self.bufnr, line, root_end_row + 1)
state.iter =
highlighter_query:query():iter_captures(root_node, self.bufnr, line, root_end_row + 1)
end
while line >= state.next_row do

View File

@@ -32,10 +32,8 @@ function LanguageTree.new(source, lang, opts)
_regions = {},
_trees = {},
_opts = opts,
_injection_query = injections[lang] and query.parse_query(lang, injections[lang]) or query.get_query(
lang,
'injections'
),
_injection_query = injections[lang] and query.parse_query(lang, injections[lang])
or query.get_query(lang, 'injections'),
_valid = false,
_parser = vim._create_ts_parser(lang),
_callbacks = {