Skip to content

Commit

Permalink
feat: add hoogle.web-search.base_url option
Browse files Browse the repository at this point in the history
  • Loading branch information
ners authored and mrcjkb committed Oct 20, 2024
1 parent 102c1f3 commit d842662
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit d842662

Please sign in to comment.