diff options
| author | William Boman <william@redwill.se> | 2022-01-06 18:21:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-06 18:21:19 +0100 |
| commit | 5cc73ef7360866c65169e0e7d55d3b59fb3b6eaa (patch) | |
| tree | b958f26ae3964e7ba8aa3572b81ece1e23b49df1 /lua/nvim-lsp-installer/fs.lua | |
| parent | rerun autogen (diff) | |
| download | mason-5cc73ef7360866c65169e0e7d55d3b59fb3b6eaa.tar mason-5cc73ef7360866c65169e0e7d55d3b59fb3b6eaa.tar.gz mason-5cc73ef7360866c65169e0e7d55d3b59fb3b6eaa.tar.bz2 mason-5cc73ef7360866c65169e0e7d55d3b59fb3b6eaa.tar.lz mason-5cc73ef7360866c65169e0e7d55d3b59fb3b6eaa.tar.xz mason-5cc73ef7360866c65169e0e7d55d3b59fb3b6eaa.tar.zst mason-5cc73ef7360866c65169e0e7d55d3b59fb3b6eaa.zip | |
feat(ui): display outdated servers (#395)
Diffstat (limited to 'lua/nvim-lsp-installer/fs.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/fs.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/fs.lua b/lua/nvim-lsp-installer/fs.lua index 38ac053f..3725f154 100644 --- a/lua/nvim-lsp-installer/fs.lua +++ b/lua/nvim-lsp-installer/fs.lua @@ -101,6 +101,17 @@ function M.write_file(path, contents) assert(uv.fs_close(fd)) end +---@param path string @The full path to the file to read. +function M.read_file(path) + log.fmt_debug("fs: read_file %s", path) + assert_ownership(path) + local fd = assert(uv.fs_open(path, "r", 438)) + local fstat = assert(uv.fs_fstat(fd)) + local contents = assert(uv.fs_read(fd, fstat.size, 0)) + assert(uv.fs_close(fd)) + return contents +end + function M.append_file(path, contents) log.fmt_debug("fs: append_file %s", path) assert_ownership(path) |
