diff options
Diffstat (limited to 'lua/nvim-lsp-installer/path.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/path.lua | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/lua/nvim-lsp-installer/path.lua b/lua/nvim-lsp-installer/path.lua index 533be48d..5d3fcee4 100644 --- a/lua/nvim-lsp-installer/path.lua +++ b/lua/nvim-lsp-installer/path.lua @@ -27,17 +27,6 @@ function M.concat(path_components) return table.concat(path_components, sep) end --- @param relpath string The relative path to get the realpath(1) to. --- @param depth number The depth in the call stack to introspect. This effectively controls which stack frame should be used when producing the realpath. --- The file of the elected stack frame will be used as the "starting point" for the provided relpath. --- --- @return The realpath (absolute path). Note that this will currently produce results such as /Users/zuck/./script.js which may not be compatible with some tools. -function M.realpath(relpath, depth) - local callsite_abs_path = debug.getinfo(depth or 2, "S").source:sub(2) - local normalized_relpath = relpath:gsub("./", "") - return M.concat { vim.fn.fnamemodify(callsite_abs_path, ":h"), normalized_relpath } -end - function M.is_subdirectory(root_path, path) return root_path == path or path:sub(1, #root_path + 1) == root_path .. sep end |
