Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add hoogle.web-search.base_url option #409

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lua/haskell-tools/hoogle/web.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ end
---@field hoogle haskell-tools.hoogle.web-search.Opts|nil

---@class haskell-tools.hoogle.web-search.Opts
---@field base_url string|nil The base URL of the hoogle server
---@field scope string|nil The scope of the search
---@field json boolean|nil Whather to request JSON enocded results

Expand All @@ -42,7 +43,8 @@ end
local function mk_hoogle_request(search_term, opts)
local hoogle_opts = opts.hoogle or {}
local scope_param = hoogle_opts.scope and '&scope=' .. hoogle_opts.scope or ''
local hoogle_request = 'https://hoogle.haskell.org/?hoogle='
local hoogle_request = (hoogle_opts.base_url or 'https://hoogle.haskell.org')
.. '/?hoogle='
.. urlencode(search_term)
.. scope_param
.. (hoogle_opts.json and '&mode=json' or '')
Expand Down