diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-11 16:32:19 -0500 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-11 17:05:55 -0500 |
| commit | 0e266bfc29a1ab17b9143235870c695ea74d6490 (patch) | |
| tree | e077917c5bd18d6a76298c035d004557b84f5ada | |
| parent | chore: clean up parsers.lua (diff) | |
| download | nvim-treesitter-0e266bfc29a1ab17b9143235870c695ea74d6490.tar nvim-treesitter-0e266bfc29a1ab17b9143235870c695ea74d6490.tar.gz nvim-treesitter-0e266bfc29a1ab17b9143235870c695ea74d6490.tar.bz2 nvim-treesitter-0e266bfc29a1ab17b9143235870c695ea74d6490.tar.lz nvim-treesitter-0e266bfc29a1ab17b9143235870c695ea74d6490.tar.xz nvim-treesitter-0e266bfc29a1ab17b9143235870c695ea74d6490.tar.zst nvim-treesitter-0e266bfc29a1ab17b9143235870c695ea74d6490.zip | |
docs: add missing fields from InstallInfo, update code docs related to installation
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 2 | ||||
| -rw-r--r-- | lua/nvim-treesitter/shell_command_selectors.lua | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index da85e9bec..b772205a2 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -53,6 +53,8 @@ end ---@field generate_requires_npm boolean|nil ---@field requires_generate_from_grammar boolean|nil ---@field location string|nil +---@field use_makefile boolean|nil +---@field cxx_standard string|nil ---@class ParserInfo ---@field install_info InstallInfo diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua index 7a0610a98..353b30f26 100644 --- a/lua/nvim-treesitter/shell_command_selectors.lua +++ b/lua/nvim-treesitter/shell_command_selectors.lua @@ -16,6 +16,7 @@ end local M = {} +-- Returns the mkdir command based on the OS ---@param directory string ---@param cwd string ---@param info_msg string @@ -44,6 +45,7 @@ function M.select_mkdir_cmd(directory, cwd, info_msg) end end +-- Returns the remove command based on the OS ---@param file string ---@param info_msg string ---@return table @@ -77,6 +79,7 @@ function M.select_executable(executables) end, executables)[1] end +-- Returns the compiler arguments based on the compiler and OS ---@param repo InstallInfo ---@param compiler string ---@return string[] @@ -125,6 +128,11 @@ function M.select_compiler_args(repo, compiler) end end +-- Returns the compile command based on the OS and user options +---@param repo InstallInfo +---@param cc string +---@param compile_location string +---@return Command function M.select_compile_command(repo, cc, compile_location) local make = M.select_executable { "gmake", "make" } if @@ -160,6 +168,10 @@ function M.select_compile_command(repo, cc, compile_location) end end +-- Returns the remove command based on the OS +---@param cache_folder string +---@param project_name string +---@return Command function M.select_install_rm_cmd(cache_folder, project_name) if fn.has "win32" == 1 then local dir = cache_folder .. "\\" .. project_name @@ -179,6 +191,11 @@ function M.select_install_rm_cmd(cache_folder, project_name) end end +-- Returns the move command based on the OS +---@param from string +---@param to string +---@param cwd string +---@return Command function M.select_mv_cmd(from, to, cwd) if fn.has "win32" == 1 then return { |
