diff options
| author | William Boman <william@redwill.se> | 2022-07-14 17:27:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-14 17:27:12 +0200 |
| commit | 63de62cd0b0b53c5946d67ee2a3c2dac16379707 (patch) | |
| tree | 54d69e3bc51370787dfef71856747727ed5a84d5 /lua/mason-core/installer/context.lua | |
| parent | fix(arduino_language_server): fix Windows asset files (#72) (diff) | |
| download | mason-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/installer/context.lua')
| -rw-r--r-- | lua/mason-core/installer/context.lua | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lua/mason-core/installer/context.lua b/lua/mason-core/installer/context.lua index 3e701d8e..a3577cfa 100644 --- a/lua/mason-core/installer/context.lua +++ b/lua/mason-core/installer/context.lua @@ -53,39 +53,39 @@ function ContextualFs.new(cwd) end ---@async ----@param rel_path string @The relative path from the current working directory to the file to append. +---@param rel_path string: The relative path from the current working directory to the file to append. ---@param contents string function ContextualFs:append_file(rel_path, contents) return fs.async.append_file(path.concat { self.cwd:get(), rel_path }, contents) end ---@async ----@param rel_path string @The relative path from the current working directory to the file to write. +---@param rel_path string: The relative path from the current working directory to the file to write. ---@param contents string function ContextualFs:write_file(rel_path, contents) return fs.async.write_file(path.concat { self.cwd:get(), rel_path }, contents) end ---@async ----@param rel_path string @The relative path from the current working directory. +---@param rel_path string: The relative path from the current working directory. function ContextualFs:file_exists(rel_path) return fs.async.file_exists(path.concat { self.cwd:get(), rel_path }) end ---@async ----@param rel_path string @The relative path from the current working directory. +---@param rel_path string: The relative path from the current working directory. function ContextualFs:dir_exists(rel_path) return fs.async.dir_exists(path.concat { self.cwd:get(), rel_path }) end ---@async ----@param rel_path string @The relative path from the current working directory. +---@param rel_path string: The relative path from the current working directory. function ContextualFs:rmrf(rel_path) return fs.async.rmrf(path.concat { self.cwd:get(), rel_path }) end ---@async ----@param rel_path string @The relative path from the current working directory. +---@param rel_path string: The relative path from the current working directory. function ContextualFs:unlink(rel_path) return fs.async.unlink(path.concat { self.cwd:get(), rel_path }) end @@ -104,7 +104,7 @@ function ContextualFs:mkdir(dirpath) end ---@class CwdManager ----@field private install_prefix string @Defines the upper boundary for which paths are allowed as cwd. +---@field private install_prefix string: Defines the upper boundary for which paths are allowed as cwd. ---@field private cwd string local CwdManager = {} CwdManager.__index = CwdManager @@ -185,8 +185,8 @@ function InstallContext:promote_cwd() self.cwd:set(install_path) end ----@param rel_path string @The relative path from the current working directory to change cwd to. Will only restore to the initial cwd after execution of fn (if provided). ----@param fn async fun() @(optional) The function to run in the context of the given path. +---@param rel_path string: The relative path from the current working directory to change cwd to. Will only restore to the initial cwd after execution of fn (if provided). +---@param fn async (fun()): (optional) The function to run in the context of the given path. function InstallContext:chdir(rel_path, fn) local old_cwd = self.cwd:get() self.cwd:set(path.concat { old_cwd, rel_path }) @@ -200,8 +200,8 @@ function InstallContext:chdir(rel_path, fn) end end ----@param new_executable_rel_path string @Relative path to the executable file to create. ----@param script_rel_path string @Relative path to the Node.js script. +---@param new_executable_rel_path string: Relative path to the executable file to create. +---@param script_rel_path string: Relative path to the Node.js script. function InstallContext:write_node_exec_wrapper(new_executable_rel_path, script_rel_path) return self:write_shell_exec_wrapper( new_executable_rel_path, @@ -212,7 +212,7 @@ function InstallContext:write_node_exec_wrapper(new_executable_rel_path, script_ ) end ----@param new_executable_rel_path string @Relative path to the executable file to create. +---@param new_executable_rel_path string: Relative path to the executable file to create. ---@param target_executable_rel_path string function InstallContext:write_exec_wrapper(new_executable_rel_path, target_executable_rel_path) return self:write_shell_exec_wrapper( @@ -224,9 +224,9 @@ function InstallContext:write_exec_wrapper(new_executable_rel_path, target_execu ) end ----@param new_executable_rel_path string @Relative path to the executable file to create. ----@param command string @The shell command to run. ----@return string @The created executable filename. +---@param new_executable_rel_path string: Relative path to the executable file to create. +---@param command string: The shell command to run. +---@return string: The created executable filename. function InstallContext:write_shell_exec_wrapper(new_executable_rel_path, command) return platform.when { unix = function() |
