local map = require 'config.helpers.keymap' local n = map 'n' ---@param buffer number ---@param ht HaskellTools local function on_attach(_, buffer, ht) n 'hc' (vim.lsp.codelens.run) {'Run codelens', buffer} n 'hs' (ht.hoogle.hoogle_signature) {'Hoogle: search', buffer} n 'he' (ht.lsp.buf_eval_all) {'Haskell: eval all', buffer} local function repl_file() local name = vim.api.nvim_buf_get_name(0) ht.repl.toggle(name) end n 'rf' (repl_file) 'Repl: Toggle GHCi for the current buffer' n 'rr' (ht.repl.toggle) {'Repl: Toggle GHCi for the current package', buffer} n 'rq' (ht.repl.quit) {'Repl: Quit', buffer} -- Detect nvim-dap launch configurations -- (requires nvim-dap and haskell-debug-adapter) -- ht.dap.discover_configurations(bufnr) end return function() vim.g.haskell_tools = { ---@type HaskellLspClientOpts` hls = { on_attach = on_attach } } end