Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
fix(hls): override lspinfo function to use locally isntalled executable
Browse files Browse the repository at this point in the history
Since these executables are not installed on PATH (yet..), lspconfig's
implementation in their `lspinfo` function will throw an error. This
overrides that function with an exact copy, with the only difference
being that we supply the absolute path to the command.

Closes #844.
  • Loading branch information
williamboman committed Jul 3, 2022
1 parent c13ea61 commit 0000290
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lua/nvim-lsp-installer/servers/hls/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ return function(name, root_dir)
ctx.receipt:with_primary_source(ctx.receipt.github_release(repo, release))
end,
default_options = {
lspinfo = function(cfg)
local extra = {}
local function on_stdout(_, data, _)
local version = data[1]
table.insert(extra, "version: " .. version)
end

local opts = {
cwd = cfg.cwd,
stdout_buffered = true,
on_stdout = on_stdout,
}
local chanid = vim.fn.jobstart({ path.concat { root_dir, "bin", cfg.cmd[1] }, "--version" }, opts)
vim.fn.jobwait { chanid }
return extra
end,
cmd_env = {
PATH = process.extend_path {
platform.is_win and root_dir or path.concat { root_dir, "bin" },
Expand Down

0 comments on commit 0000290

Please sign in to comment.