mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
docs: add missing fields from InstallInfo, update code docs related to installation
This commit is contained in:
parent
4b04eaa5ce
commit
0e266bfc29
2 changed files with 19 additions and 0 deletions
|
|
@ -53,6 +53,8 @@ end
|
||||||
---@field generate_requires_npm boolean|nil
|
---@field generate_requires_npm boolean|nil
|
||||||
---@field requires_generate_from_grammar boolean|nil
|
---@field requires_generate_from_grammar boolean|nil
|
||||||
---@field location string|nil
|
---@field location string|nil
|
||||||
|
---@field use_makefile boolean|nil
|
||||||
|
---@field cxx_standard string|nil
|
||||||
|
|
||||||
---@class ParserInfo
|
---@class ParserInfo
|
||||||
---@field install_info InstallInfo
|
---@field install_info InstallInfo
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ end
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
-- Returns the mkdir command based on the OS
|
||||||
---@param directory string
|
---@param directory string
|
||||||
---@param cwd string
|
---@param cwd string
|
||||||
---@param info_msg string
|
---@param info_msg string
|
||||||
|
|
@ -44,6 +45,7 @@ function M.select_mkdir_cmd(directory, cwd, info_msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns the remove command based on the OS
|
||||||
---@param file string
|
---@param file string
|
||||||
---@param info_msg string
|
---@param info_msg string
|
||||||
---@return table
|
---@return table
|
||||||
|
|
@ -77,6 +79,7 @@ function M.select_executable(executables)
|
||||||
end, executables)[1]
|
end, executables)[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns the compiler arguments based on the compiler and OS
|
||||||
---@param repo InstallInfo
|
---@param repo InstallInfo
|
||||||
---@param compiler string
|
---@param compiler string
|
||||||
---@return string[]
|
---@return string[]
|
||||||
|
|
@ -125,6 +128,11 @@ function M.select_compiler_args(repo, compiler)
|
||||||
end
|
end
|
||||||
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)
|
function M.select_compile_command(repo, cc, compile_location)
|
||||||
local make = M.select_executable { "gmake", "make" }
|
local make = M.select_executable { "gmake", "make" }
|
||||||
if
|
if
|
||||||
|
|
@ -160,6 +168,10 @@ function M.select_compile_command(repo, cc, compile_location)
|
||||||
end
|
end
|
||||||
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)
|
function M.select_install_rm_cmd(cache_folder, project_name)
|
||||||
if fn.has "win32" == 1 then
|
if fn.has "win32" == 1 then
|
||||||
local dir = cache_folder .. "\\" .. project_name
|
local dir = cache_folder .. "\\" .. project_name
|
||||||
|
|
@ -179,6 +191,11 @@ function M.select_install_rm_cmd(cache_folder, project_name)
|
||||||
end
|
end
|
||||||
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)
|
function M.select_mv_cmd(from, to, cwd)
|
||||||
if fn.has "win32" == 1 then
|
if fn.has "win32" == 1 then
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue