Skip to content

Commit

Permalink
style: stylua fmt (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ANGkeith committed Jan 20, 2024
1 parent 596b1a0 commit bbe2c44
Showing 1 changed file with 43 additions and 37 deletions.
80 changes: 43 additions & 37 deletions lua/telescope/_extensions/terraform_doc/builtin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,53 +21,59 @@ function M.search(opts)

local provider_version_meta = M_api.get_provider_versions_id_meta(opts.full_name, opts.version)

pickers.new(opts, {
prompt_title = M_api.gen_prompt_title(provider_version_meta),
sorter = conf.generic_sorter(opts),
finder = finders.new_table({
results = M_api.get_provider_resources(provider_version_meta.id),
entry_maker = M_make_entry.gen_from_run(opts),
}),
attach_mappings = function(_, map)
actions.select_default:replace(M_actions.url_opener(opts))
map("i", "<c-d>", M_actions.doc_view(opts))
return true
end,
}):find()
pickers
.new(opts, {
prompt_title = M_api.gen_prompt_title(provider_version_meta),
sorter = conf.generic_sorter(opts),
finder = finders.new_table({
results = M_api.get_provider_resources(provider_version_meta.id),
entry_maker = M_make_entry.gen_from_run(opts),
}),
attach_mappings = function(_, map)
actions.select_default:replace(M_actions.url_opener(opts))
map("i", "<c-d>", M_actions.doc_view(opts))
return true
end,
})
:find()
end

function M.providers(opts)
opts = vim.tbl_extend("keep", opts, M_opts)

pickers.new(opts, {
prompt_title = "Official Hashicorp Providers",
sorter = conf.generic_sorter(opts),
finder = finders.new_table({
results = M_api.get_official_providers(),
entry_maker = M_make_entry.gen_from_providers(opts),
}),
attach_mappings = function(_)
actions.select_default:replace(M_actions.search_selected_providers(opts))
return true
end,
}):find()
pickers
.new(opts, {
prompt_title = "Official Hashicorp Providers",
sorter = conf.generic_sorter(opts),
finder = finders.new_table({
results = M_api.get_official_providers(),
entry_maker = M_make_entry.gen_from_providers(opts),
}),
attach_mappings = function(_)
actions.select_default:replace(M_actions.search_selected_providers(opts))
return true
end,
})
:find()
end

function M.modules(opts)
opts = vim.tbl_extend("keep", opts, M_opts)

pickers.new(opts, {
prompt_title = "Terraform Modules",
sorter = conf.generic_sorter(opts),
finder = finders.new_table({
results = M_local_api.get_modules(),
entry_maker = M_make_entry.gen_from_modules(opts),
}),
attach_mappings = function(_)
actions.select_default:replace(M_actions.url_opener_module(opts))
return true
end,
}):find()
pickers
.new(opts, {
prompt_title = "Terraform Modules",
sorter = conf.generic_sorter(opts),
finder = finders.new_table({
results = M_local_api.get_modules(),
entry_maker = M_make_entry.gen_from_modules(opts),
}),
attach_mappings = function(_)
actions.select_default:replace(M_actions.url_opener_module(opts))
return true
end,
})
:find()
end

return M

0 comments on commit bbe2c44

Please sign in to comment.