From ee8a05fb36d6ce88de4455b9deb53c7ab775bdbd Mon Sep 17 00:00:00 2001 From: czwinzscher <40801720+czwinzscher@users.noreply.github.com> Date: Sun, 17 Nov 2019 20:07:09 +0100 Subject: Add support for haskell-ide-engine (#21) --- lua/nvim_lsp.lua | 1 + lua/nvim_lsp/hie.lua | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 lua/nvim_lsp/hie.lua diff --git a/lua/nvim_lsp.lua b/lua/nvim_lsp.lua index c5eb0d01..74d547fa 100644 --- a/lua/nvim_lsp.lua +++ b/lua/nvim_lsp.lua @@ -6,6 +6,7 @@ require 'nvim_lsp/clangd' require 'nvim_lsp/elmls' require 'nvim_lsp/flow' require 'nvim_lsp/gopls' +require 'nvim_lsp/hie' require 'nvim_lsp/pyls' require 'nvim_lsp/rls' require 'nvim_lsp/texlab' diff --git a/lua/nvim_lsp/hie.lua b/lua/nvim_lsp/hie.lua new file mode 100644 index 00000000..dac2f7c8 --- /dev/null +++ b/lua/nvim_lsp/hie.lua @@ -0,0 +1,40 @@ +local skeleton = require 'nvim_lsp/skeleton' +local util = require 'nvim_lsp/util' +local lsp = vim.lsp + +skeleton.hie = { + default_config = { + cmd = {"hie-wrapper"}; + filetypes = {"haskell"}; + root_dir = util.root_pattern("stack.yaml", "package.yaml", ".git"); + log_level = lsp.protocol.MessageType.Warning; + settings = {}; + }; + + docs = { + description = [[ +https://github.com/haskell/haskell-ide-engine + +the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +```lua +init_options = { + languageServerHaskell = { + hlintOn = bool; + maxNumberOfProblems = number; + diagnosticsDebounceDuration = number; + liquidOn = bool (default false); + completionSnippetsOn = bool (default true); + formatOnImportOn = bool (default true); + formattingProvider = string (default "brittany", alternate "floskell"); + } +} +``` + ]]; + + default_config = { + root_dir = [[root_pattern("stack.yaml", "package.yaml", ".git")]]; + }; + }; +}; + +-- vim:et ts=2 sw=2 -- cgit v1.2.3-70-g09d2