Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add glob file type support #8006

Merged
merged 11 commits into from
Feb 11, 2024
Merged

Add glob file type support #8006

merged 11 commits into from
Feb 11, 2024

Commits on Feb 11, 2024

  1. 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.
    gjabell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    15dcbf1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8ec014c View commit details
    Browse the repository at this point in the history
  3. 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.
    gjabell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    60500b3 View commit details
    Browse the repository at this point in the history
  4. 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.
    gjabell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    273eef0 View commit details
    Browse the repository at this point in the history
  5. Make env filetype matching more generic

    Match on `.env` or any `.env.*` files.
    gjabell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    42bb2b4 View commit details
    Browse the repository at this point in the history
  6. Update docs

    gjabell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    0b7fea8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    41bbb7e View commit details
    Browse the repository at this point in the history
  8. Update todo.txt glob patterns

    gjabell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    ea0ddff View commit details
    Browse the repository at this point in the history
  9. 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.
    the-mikedavis authored and gjabell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    6038086 View commit details
    Browse the repository at this point in the history
  10. Fix integration tests

    gjabell committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    d80eb8e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3fa6017 View commit details
    Browse the repository at this point in the history