forked from chipsalliance/verible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09e602e
commit 264d499
Showing
7 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
local process = require "nvim-lsp-installer.process" | ||
local path = require "nvim-lsp-installer.path" | ||
|
||
local M = {} | ||
|
||
---@param crates string[] The crates to install. | ||
function M.crates(crates) | ||
---@type ServerInstallerFunction | ||
return function(_, callback, ctx) | ||
local args = { "install", "--root", ".", "--locked" } | ||
if ctx.requested_server_version then | ||
vim.list_extend(args, { "--version", ctx.requested_server_version }) | ||
end | ||
vim.list_extend(args, crates) | ||
|
||
process.spawn("cargo", { | ||
cwd = ctx.install_dir, | ||
args = args, | ||
stdio_sink = ctx.stdio_sink, | ||
}, callback) | ||
end | ||
end | ||
|
||
---@param root_dir string The directory to resolve the executable from. | ||
---@param executable string | ||
function M.executable(root_dir, executable) | ||
return path.concat { root_dir, "bin", executable } | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
local server = require "nvim-lsp-installer.server" | ||
local cargo = require "nvim-lsp-installer.installers.cargo" | ||
|
||
return function(name, root_dir) | ||
return server.Server:new { | ||
name = name, | ||
root_dir = root_dir, | ||
languages = { "toml" }, | ||
homepage = "https://taplo.tamasfe.dev/lsp/", | ||
installer = cargo.crates { "taplo-lsp" }, | ||
default_options = { | ||
cmd = { cargo.executable(root_dir, "taplo-lsp"), "run" }, | ||
}, | ||
} | ||
end |