1 -- If you are starting out with Haskell, nvim-lspconfig.hls is probably enough for you.
 
   2 -- It provides the lowest common denominator of LSP support.
 
   3 -- This plugin is for those who would like additional features
 
   4 -- that are specific to Haskell tooling.
 
   5 -- https://github.com/MrcJkb/haskell-tools.nvim
 
  10                 -- This is a filetype plugin that works out of the box,
 
  11                 -- so there is no need to call a setup function or configure anything
 
  12                 -- to get this plugin working.
 
  13                 vim.g.haskell_tools = {
 
  20                                 cmd = { "haskell-language-server-wrapper", "--lsp" },
 
  22                                 filetypes = { "haskell", "lhaskell" },
 
  23                                 on_attach = function(client, bufnr)
 
  24                                         local ht = require("haskell-tools")
 
  25                                         local opts = { noremap = true, silent = true, buffer = bufnr }
 
  26                                         vim.keymap.set("n", "<localleader>cl", vim.lsp.codelens.run, opts)
 
  27                                         vim.keymap.set("n", "<localleader>hs", ht.hoogle.hoogle_signature, opts)
 
  28                                         vim.keymap.set("n", "<localleader>ea", ht.lsp.buf_eval_all, opts)
 
  29                                         vim.keymap.set("n", "<localleader>rr", ht.repl.toggle, opts)
 
  30                                         vim.keymap.set("n", "<localleader>rf", function()
 
  31                                                 ht.repl.toggle(vim.api.nvim_buf_get_name(0))
 
  33                                         vim.keymap.set("n", "<localleader>rq", ht.repl.quit, opts)
 
  35                                 root_dir = function(bufnr, on_dir)
 
  36                                         local fname = vim.api.nvim_buf_get_name(bufnr)
 
  38                                                 util.root_pattern("hie.yaml", "stack.yaml", "cabal.project", "*.cabal", "package.yaml")(fname)
 
  41                                 settings = { haskell = { cabalFormattingProvider = "cabalfmt", formattingProvider = "fourmolu" } },