| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
Problem:
vim.fs.dir(), vim.fs.find() do not follow symlinks.
Solution:
- Add "follow" flag.
- Enable it by default.
|
|
|
|
|
| |
This is needed to replace the nvim-lspconfig function is_descendant that
some lspconfg configurations still use.
|
| |
|
|
|
|
|
| |
Also add tests for the current path casing behavior so it doesn't get
accidentally changed.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Problem: There is currently no way to check if a given path is absolute or convert a relative path to an absolute path through the Lua stdlib. `vim.fs.joinpath` does not work when the path is absolute. There is also currently no way to resolve `C:foo\bar` style paths in Windows.
Solution: Add `vim.fs.abspath`, which allows converting any path to an absolute path. This also allows checking if current path is absolute by doing `vim.fs.abspath(path) == path`. It also has support for `C:foo\bar` style paths in Windows.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Tests have lots of exec_lua calls which input blocks of code
provided as unformatted strings.
Solution:
Teach exec_lua how to handle functions.
|
|
|
|
| |
If a buffer does not have a backing file then fall back to the current
working directory.
|
|
|
|
|
|
| |
vim.fs.root() is a function for finding a project root relative to a
buffer using one or more "root markers". This is useful for LSP and
could be useful for other "projects" designs, as well as for any plugins
which work with a "projects" concept.
|
|
|
|
|
|
|
|
|
| |
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.
Closes https://github.com/neovim/neovim/issues/27004.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`vim.fs.normalize` does not resolve `.` and `..` components. This makes
no sense as the entire point of normalization is to remove redundancy
from the path. The path normalization functions in several other
languages (Java, Python, C++, etc.) also resolve `.` and `..`
components.
Reference:
- Python: https://docs.python.org/3/library/os.path.html#os.path.normpath
- Java: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#normalize--
- C++: https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal
Solution:
Resolve "." and ".." in `vim.fs.normalize`.
Before:
"~/foo/bar/../baz/./" => "~/foo/bar/../baz/."
After:
"~/foo/bar/../baz/./" => "~/foo/baz"
|
| |
|
|
|
|
| |
Work on https://github.com/neovim/neovim/issues/27004.
|
|
|
|
| |
Closes https://github.com/neovim/neovim/issues/27068.
|
|
|
|
|
|
|
| |
Backslashes are valid characters in unix style paths.
Fix the conversion of backslashes to forward slashes in several `vim.fs`
functions when not on Windows. On Windows, backslashes will still be converted
to forward slashes.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
The exec_lua wrapper is no longer necessary.
|
|
|
| |
Also simplify home detection with os_homedir()
|
|
|
| |
Preserve last slash in windows' root drive directories
|
|
|
|
|
|
|
| |
Problem: Current implementation of "remove trailing /" doesn't
account for the case of literal '/' as path.
Solution: Remove trailing / only if it preceded by something else.
Co-authored by: notomo <notomo.motono@gmail.com>
|
|
|
| |
This is a small function but used a lot in some plugins.
|
|
|
|
|
|
| |
Uncrustify is sensitive to version changes, which causes friction for
contributors that doesn't have that exact version. It's also simpler to
download and install the correct version than to have bespoke version
checking.
|
| |
|
|
|
|
|
|
| |
test: replace lfs with luv
luv already pretty much does everything lfs does, so this duplication
of dependencies isn't needed.
|
|
|
|
|
| |
Searching the entire repo for a directory named "contrib" causes failure
if there happens to be another subdirectory with the name "contrib".
Instead, point directly to the correct contrib directory.
|
|
|
|
|
|
|
|
| |
Problem:
No easy way to find files under certain directories (ex: grab all files under
`test/`) or exclude the content of certain paths (ex. `build/`, `.git/`)
Solution:
Pass the full `path` as an arg to the predicate.
|
|
|
| |
Fixes #21497
|
| |
|
| |
|
|
|
|
| |
Added option depth to allow recursively searching a directory tree.
|
|
|
|
| |
Avoid using vim.env and vim.fn in vim.fs functions so that
they can be used in "fast" contexts.
|
|
|
|
|
| |
Extend the capabilities of is_os to detect more platforms such as
freebsd and openbsd. Also remove `iswin()` helper function as it can be
replaced by `is_os("win")`.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Makes it possible to use `vim.fs.find` to find files where only a
substring is known.
This is useful for `vim.lsp.start` to get the `root_dir` for languages
where the project-file is only known by its extension, not by the full
name.
For example in .NET projects there is usually a `<projectname>.csproj`
file in the project root.
Example:
vim.fs.find(function(x) return vim.endswith(x, '.csproj') end, { upward = true })
|
| |
|
|
|
|
|
| |
This is a pure Lua implementation of the Vim findfile() and finddir()
functions without the special syntax.
|
|
|
|
|
| |
This function is modeled after the path.dir() function from Penlight and
the luafilesystem module.
|
| |
|
| |
|
|
vim.fs.parents() is a Lua iterator that returns the next parent
directory of the given file or directory on each iteration.
|