-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add glob file type support #8006
Commits on Feb 11, 2024
-
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.
Configuration menu - View commit details
-
Copy full SHA for 15dcbf1 - Browse repository at this point
Copy the full SHA 15dcbf1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ec014c - Browse repository at this point
Copy the full SHA 8ec014cView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 60500b3 - Browse repository at this point
Copy the full SHA 60500b3View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 273eef0 - Browse repository at this point
Copy the full SHA 273eef0View commit details -
Make env filetype matching more generic
Match on `.env` or any `.env.*` files.
Configuration menu - View commit details
-
Copy full SHA for 42bb2b4 - Browse repository at this point
Copy the full SHA 42bb2b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b7fea8 - Browse repository at this point
Copy the full SHA 0b7fea8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 41bbb7e - Browse repository at this point
Copy the full SHA 41bbb7eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ea0ddff - Browse repository at this point
Copy the full SHA ea0ddffView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 6038086 - Browse repository at this point
Copy the full SHA 6038086View commit details -
Configuration menu - View commit details
-
Copy full SHA for d80eb8e - Browse repository at this point
Copy the full SHA d80eb8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3fa6017 - Browse repository at this point
Copy the full SHA 3fa6017View commit details