helix-mods/helix-term/tests/test
Galen Abell 581a1ebf5d
Add glob file type support (#8006)
* Replace FileType::Suffix with FileType::Glob

Suffix is rather limited and cannot be used to match files which have
semantic meaning based on location + file type (for example, Github
Action workflow files). This patch adds support for a Glob FileType to
replace Suffix, which encompasses the existing behavior & adds
additional file matching functionality.

Globs are standard Unix-style path globs, which are matched against the
absolute path of the file. If the configured glob for a language is a
relative glob (that is, it isn't an absolute path or already starts with
a glob pattern), a glob pattern will be prepended to allow matching
relative paths from any directory.

The order of file type matching is also updated to first match on globs
and then on extension. This is necessary as most cases where
glob-matching is useful will have already been matched by an extension
if glob matching is done last.

* Convert file-types suffixes to globs

* Use globs for filename matching

Trying to match the file-type raw strings against both filename and
extension leads to files with the same name as the extension having the
incorrect syntax.

* Match dockerfiles with suffixes

It's common practice to add a suffix to dockerfiles based on their
context, e.g. `Dockerfile.dev`, `Dockerfile.prod`, etc.

* Make env filetype matching more generic

Match on `.env` or any `.env.*` files.

* Update docs

* Use GlobSet to match all file type globs at once

* Update todo.txt glob patterns

* Consolidate language Configuration and Loader creation

This is a refactor that improves the error handling for creating
the `helix_core::syntax::Loader` from the default and user language
configuration.

* Fix integration tests

* Add additional starlark file-type glob

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-02-11 18:24:20 +01:00
..
commands Add glob file type support (#8006) 2024-02-11 18:24:20 +01:00
languages Fix YAML auto indent 2023-08-11 06:22:22 +09:00
auto_indent.rs migrate test_with_config to use AppBuilder 2023-03-20 18:34:40 -05:00
auto_pairs.rs Add config for default line ending (#5621) 2023-06-16 12:02:15 -05:00
commands.rs Join empty lines with only one space in join_selections (#8989) 2023-12-06 16:19:54 +01:00
helpers.rs Add glob file type support (#8006) 2024-02-11 18:24:20 +01:00
movement.rs Fix find commands for buffers with non-LF line-endings (#8111) 2023-09-03 23:12:38 +02:00
prompt.rs flush writes on force quit (#4397) 2022-10-21 13:28:29 +09:00
splits.rs Create helix-stdx crate for stdlib extensions 2024-01-18 10:57:53 +09:00