From ab103e12314e7a134b92da2219340e5a11e2c9d7 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 8 Mar 2021 19:46:18 +0100 Subject: fix(hls): log is configured via haskell.logFile and not languageServerHaskell.logFile display server pid --- lua/lspconfig/hls.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lua/lspconfig/hls.lua') diff --git a/lua/lspconfig/hls.lua b/lua/lspconfig/hls.lua index b0df2fa0..38975c22 100644 --- a/lua/lspconfig/hls.lua +++ b/lua/lspconfig/hls.lua @@ -7,16 +7,25 @@ configs.hls = { filetypes = { 'haskell', 'lhaskell' }, root_dir = util.root_pattern('*.cabal', 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml'), settings = { - languageServerHaskell = { + haskell = { formattingProvider = 'ormolu', }, }, lspinfo = function(cfg) - -- return "specific" - if cfg.settings.languageServerHaskell.logFile or false then - return 'logfile: ' .. cfg.settings.languageServerHaskell.logFile + local extra = {} + local function on_stdout(_, data, _) + local version = data[1] + table.insert(extra, 'version: ' .. version) end - return '' + + local opts = { + cwd = cfg.cwd, + stdout_buffered = true, + on_stdout = on_stdout, + } + local chanid = vim.fn.jobstart({ cfg.cmd[1], '--version' }, opts) + vim.fn.jobwait { chanid } + return extra end, }, -- cgit v1.2.3-70-g09d2