aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/managers
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-07-14 17:27:12 +0200
committerGitHub <noreply@github.com>2022-07-14 17:27:12 +0200
commit63de62cd0b0b53c5946d67ee2a3c2dac16379707 (patch)
tree54d69e3bc51370787dfef71856747727ed5a84d5 /lua/mason-core/managers
parentfix(arduino_language_server): fix Windows asset files (#72) (diff)
downloadmason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar
mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.gz
mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.bz2
mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.lz
mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.xz
mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.tar.zst
mason-63de62cd0b0b53c5946d67ee2a3c2dac16379707.zip
chore: change emmylua annotation syntax from @ to : for comments (#73)
Diffstat (limited to 'lua/mason-core/managers')
-rw-r--r--lua/mason-core/managers/cargo/client.lua2
-rw-r--r--lua/mason-core/managers/cargo/init.lua4
-rw-r--r--lua/mason-core/managers/composer/init.lua4
-rw-r--r--lua/mason-core/managers/gem/init.lua4
-rw-r--r--lua/mason-core/managers/git/init.lua2
-rw-r--r--lua/mason-core/managers/github/client.lua22
-rw-r--r--lua/mason-core/managers/go/init.lua6
-rw-r--r--lua/mason-core/managers/luarocks/init.lua4
-rw-r--r--lua/mason-core/managers/npm/init.lua8
-rw-r--r--lua/mason-core/managers/opam/init.lua4
-rw-r--r--lua/mason-core/managers/pip3/init.lua4
-rw-r--r--lua/mason-core/managers/std/init.lua4
12 files changed, 34 insertions, 34 deletions
diff --git a/lua/mason-core/managers/cargo/client.lua b/lua/mason-core/managers/cargo/client.lua
index 3df7550b..ae04691d 100644
--- a/lua/mason-core/managers/cargo/client.lua
+++ b/lua/mason-core/managers/cargo/client.lua
@@ -6,7 +6,7 @@ local M = {}
---@async
---@param crate string
----@return Result @of Crate
+---@return Result: of Crate
function M.fetch_crate(crate)
return fetch(("https://crates.io/api/v1/crates/%s"):format(crate)):map_catching(vim.json.decode)
end
diff --git a/lua/mason-core/managers/cargo/init.lua b/lua/mason-core/managers/cargo/init.lua
index 5b87667c..c2d4f41d 100644
--- a/lua/mason-core/managers/cargo/init.lua
+++ b/lua/mason-core/managers/cargo/init.lua
@@ -76,8 +76,8 @@ function M.install(crate, opts)
}
end
----@param output string @The `cargo install --list` output.
----@return table<string, string> @Key is the crate name, value is its version.
+---@param output string: The `cargo install --list` output.
+---@return table<string, string>: Key is the crate name, value is its version.
function M.parse_installed_crates(output)
local installed_crates = {}
for _, line in ipairs(vim.split(output, "\n")) do
diff --git a/lua/mason-core/managers/composer/init.lua b/lua/mason-core/managers/composer/init.lua
index 96ab5f14..31c792a9 100644
--- a/lua/mason-core/managers/composer/init.lua
+++ b/lua/mason-core/managers/composer/init.lua
@@ -26,7 +26,7 @@ local function with_receipt(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The composer packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The composer packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.packages(packages)
return function()
return M.require(packages).with_receipt()
@@ -34,7 +34,7 @@ function M.packages(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The composer packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The composer packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.require(packages)
local ctx = installer.context()
local pkgs = _.list_copy(packages)
diff --git a/lua/mason-core/managers/gem/init.lua b/lua/mason-core/managers/gem/init.lua
index 11019985..8b64d68a 100644
--- a/lua/mason-core/managers/gem/init.lua
+++ b/lua/mason-core/managers/gem/init.lua
@@ -25,7 +25,7 @@ local function with_receipt(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The Gem packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The Gem packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.packages(packages)
return function()
return M.install(packages).with_receipt()
@@ -33,7 +33,7 @@ function M.packages(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The Gem packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The Gem packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.install(packages)
local ctx = installer.context()
local pkgs = _.list_copy(packages or {})
diff --git a/lua/mason-core/managers/git/init.lua b/lua/mason-core/managers/git/init.lua
index 432d18f4..c363cbe8 100644
--- a/lua/mason-core/managers/git/init.lua
+++ b/lua/mason-core/managers/git/init.lua
@@ -14,7 +14,7 @@ local function with_receipt(repo)
end
---@async
----@param opts {[1]: string, recursive: boolean, version: Optional|nil} @The first item in the table is the repository to clone.
+---@param opts {[1]: string, recursive: boolean, version: Optional|nil}: The first item in the table is the repository to clone.
function M.clone(opts)
local ctx = installer.context()
local repo = assert(opts[1], "No git URL provided.")
diff --git a/lua/mason-core/managers/github/client.lua b/lua/mason-core/managers/github/client.lua
index 1bcede7a..b2ddb44d 100644
--- a/lua/mason-core/managers/github/client.lua
+++ b/lua/mason-core/managers/github/client.lua
@@ -10,7 +10,7 @@ local M = {}
---@alias GitHubTag {name: string}
---@param path string
----@return Result @JSON decoded response.
+---@return Result: JSON decoded response.
local function api_call(path)
return spawn
.gh({ "api", path })
@@ -22,8 +22,8 @@ local function api_call(path)
end
---@async
----@param repo string @The GitHub repo ("username/repo").
----@return Result @of GitHubRelease[]
+---@param repo string: The GitHub repo ("username/repo").
+---@return Result: of GitHubRelease[]
function M.fetch_releases(repo)
log.fmt_trace("Fetching GitHub releases for repo=%s", repo)
local path = ("repos/%s/releases"):format(repo)
@@ -33,8 +33,8 @@ function M.fetch_releases(repo)
end
---@async
----@param repo string @The GitHub repo ("username/repo").
----@param tag_name string @The tag_name of the release to fetch.
+---@param repo string: The GitHub repo ("username/repo").
+---@param tag_name string: The tag_name of the release to fetch.
function M.fetch_release(repo, tag_name)
log.fmt_trace("Fetching GitHub release for repo=%s, tag_name=%s", repo, tag_name)
local path = ("repos/%s/releases/tags/%s"):format(repo, tag_name)
@@ -59,9 +59,9 @@ end
---@alias FetchLatestGithubReleaseOpts {tag_name_pattern:string|nil, include_prerelease: boolean}
---@async
----@param repo string @The GitHub repo ("username/repo").
+---@param repo string: The GitHub repo ("username/repo").
---@param opts FetchLatestGithubReleaseOpts|nil
----@return Result @of GitHubRelease
+---@return Result: of GitHubRelease
function M.fetch_latest_release(repo, opts)
opts = opts or {
tag_name_pattern = nil,
@@ -86,8 +86,8 @@ function M.fetch_latest_release(repo, opts)
end
---@async
----@param repo string @The GitHub repo ("username/repo").
----@return Result @of GitHubTag[]
+---@param repo string: The GitHub repo ("username/repo").
+---@return Result: of GitHubTag[]
function M.fetch_tags(repo)
local path = ("repos/%s/tags"):format(repo)
return api_call(path):map_err(function()
@@ -96,8 +96,8 @@ function M.fetch_tags(repo)
end
---@async
----@param repo string @The GitHub repo ("username/repo").
----@return Result @Result<string> - The latest tag name.
+---@param repo string: The GitHub repo ("username/repo").
+---@return Result: Result<string> - The latest tag name.
function M.fetch_latest_tag(repo)
-- https://github.com/williamboman/vercel-github-api-latest-tag-proxy
return fetch(("https://latest-github-tag.redwill.se/api/latest-tag?repo=%s"):format(repo))
diff --git a/lua/mason-core/managers/go/init.lua b/lua/mason-core/managers/go/init.lua
index dbdfdc45..9c969409 100644
--- a/lua/mason-core/managers/go/init.lua
+++ b/lua/mason-core/managers/go/init.lua
@@ -24,7 +24,7 @@ local function with_receipt(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The go packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The go packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.packages(packages)
return function()
M.install(packages).with_receipt()
@@ -32,7 +32,7 @@ function M.packages(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The go packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The go packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.install(packages)
local ctx = installer.context()
local env = {
@@ -66,7 +66,7 @@ function M.install(packages)
}
end
----@param output string @The output from `go version -m` command.
+---@param output string: The output from `go version -m` command.
function M.parse_mod_version_output(output)
---@type {path: string[], mod: string[], dep: string[], build: string[]}
local result = {}
diff --git a/lua/mason-core/managers/luarocks/init.lua b/lua/mason-core/managers/luarocks/init.lua
index 7ec082c8..f98efb81 100644
--- a/lua/mason-core/managers/luarocks/init.lua
+++ b/lua/mason-core/managers/luarocks/init.lua
@@ -21,7 +21,7 @@ local function with_receipt(package)
end
end
----@param package string @The luarock package to install.
+---@param package string: The luarock package to install.
---@param opts { dev: boolean, bin : string[] | nil } | nil
function M.package(package, opts)
return function()
@@ -30,7 +30,7 @@ function M.package(package, opts)
end
---@async
----@param pkg string @The luarock package to install.
+---@param pkg string: The luarock package to install.
---@param opts { dev: boolean, bin : string[] | nil } | nil
function M.install(pkg, opts)
opts = opts or {}
diff --git a/lua/mason-core/managers/npm/init.lua b/lua/mason-core/managers/npm/init.lua
index 828afd12..b3aa0f0b 100644
--- a/lua/mason-core/managers/npm/init.lua
+++ b/lua/mason-core/managers/npm/init.lua
@@ -36,7 +36,7 @@ local function with_receipt(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The npm packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The npm packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.packages(packages)
return function()
return M.install(packages).with_receipt()
@@ -44,7 +44,7 @@ function M.packages(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The npm packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The npm packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.install(packages)
local ctx = installer.context()
local pkgs = list_copy(packages)
@@ -77,14 +77,14 @@ function M.install(packages)
end
---@async
----@param exec_args string[] @The arguments to pass to npm exec.
+---@param exec_args string[]: The arguments to pass to npm exec.
function M.exec(exec_args)
local ctx = installer.context()
ctx.spawn.npm { "exec", "--yes", "--", exec_args }
end
---@async
----@param script string @The npm script to run.
+---@param script string: The npm script to run.
function M.run(script)
local ctx = installer.context()
ctx.spawn.npm { "run", script }
diff --git a/lua/mason-core/managers/opam/init.lua b/lua/mason-core/managers/opam/init.lua
index 8b42e4e9..63654ea3 100644
--- a/lua/mason-core/managers/opam/init.lua
+++ b/lua/mason-core/managers/opam/init.lua
@@ -24,7 +24,7 @@ local function with_receipt(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The opam packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The opam packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.packages(packages)
return function()
return M.install(packages).with_receipt()
@@ -32,7 +32,7 @@ function M.packages(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The opam packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The opam packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.install(packages)
local ctx = installer.context()
local pkgs = list_copy(packages)
diff --git a/lua/mason-core/managers/pip3/init.lua b/lua/mason-core/managers/pip3/init.lua
index 9502e89e..4464c22c 100644
--- a/lua/mason-core/managers/pip3/init.lua
+++ b/lua/mason-core/managers/pip3/init.lua
@@ -28,7 +28,7 @@ local function with_receipt(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The pip packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The pip packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.packages(packages)
return function()
return M.install(packages).with_receipt()
@@ -36,7 +36,7 @@ function M.packages(packages)
end
---@async
----@param packages { [number]: string, bin: string[] | nil } @The pip packages to install. The first item in this list will be the recipient of the requested version, if set.
+---@param packages { [number]: string, bin: string[] | nil }: The pip packages to install. The first item in this list will be the recipient of the requested version, if set.
function M.install(packages)
local ctx = installer.context()
local pkgs = _.list_copy(packages)
diff --git a/lua/mason-core/managers/std/init.lua b/lua/mason-core/managers/std/init.lua
index e021a261..a0f9ecc9 100644
--- a/lua/mason-core/managers/std/init.lua
+++ b/lua/mason-core/managers/std/init.lua
@@ -163,8 +163,8 @@ function M.gunzip(file)
end
---@async
----@param flags string @The chmod flag to apply.
----@param files string[] @A list of relative paths to apply the chmod on.
+---@param flags string: The chmod flag to apply.
+---@param files string[]: A list of relative paths to apply the chmod on.
function M.chmod(flags, files)
if platform.is_unix then
local ctx = installer.context()