mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 02:46:17 +04:00
581a1ebf5d
* 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>
60 lines
1.3 KiB
TOML
60 lines
1.3 KiB
TOML
[package]
|
|
name = "helix-core"
|
|
description = "Helix editor core editing primitives"
|
|
include = ["src/**/*", "README.md"]
|
|
version.workspace = true
|
|
authors.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
categories.workspace = true
|
|
repository.workspace = true
|
|
homepage.workspace = true
|
|
|
|
[features]
|
|
unicode-lines = ["ropey/unicode_lines"]
|
|
integration = []
|
|
|
|
[dependencies]
|
|
helix-stdx = { path = "../helix-stdx" }
|
|
helix-loader = { path = "../helix-loader" }
|
|
|
|
ropey = { version = "1.6.1", default-features = false, features = ["simd"] }
|
|
smallvec = "1.13"
|
|
smartstring = "1.0.1"
|
|
unicode-segmentation = "1.10"
|
|
unicode-width = "0.1"
|
|
unicode-general-category = "0.6"
|
|
# slab = "0.4.2"
|
|
slotmap = "1.0"
|
|
tree-sitter.workspace = true
|
|
once_cell = "1.19"
|
|
arc-swap = "1"
|
|
regex = "1"
|
|
bitflags = "2.4"
|
|
ahash = "0.8.6"
|
|
hashbrown = { version = "0.14.3", features = ["raw"] }
|
|
dunce = "1.0"
|
|
|
|
log = "0.4"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
toml = "0.7"
|
|
|
|
imara-diff = "0.1.0"
|
|
|
|
encoding_rs = "0.8"
|
|
|
|
chrono = { version = "0.4", default-features = false, features = ["alloc", "std"] }
|
|
|
|
etcetera = "0.8"
|
|
textwrap = "0.16.0"
|
|
globset = "0.4.14"
|
|
|
|
nucleo.workspace = true
|
|
parking_lot = "0.12"
|
|
|
|
[dev-dependencies]
|
|
quickcheck = { version = "1", default-features = false }
|
|
indoc = "2.0.4"
|