From 68fce3e160c64c488567f0e80f8d57bbbdd9dd82 Mon Sep 17 00:00:00 2001 From: David Else <12832280+David-Else@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:00:43 +0100 Subject: [PATCH 001/393] Add tailwindcss language server (#8442) --- languages.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/languages.toml b/languages.toml index af1466f1b..8fafd5d43 100644 --- a/languages.toml +++ b/languages.toml @@ -71,6 +71,7 @@ solc = { command = "solc", args = ["--lsp"] } sourcekit-lsp = { command = "sourcekit-lsp" } svlangserver = { command = "svlangserver", args = [] } swipl = { command = "swipl", args = [ "-g", "use_module(library(lsp_server))", "-g", "lsp_server:main", "-t", "halt", "--", "stdio" ] } +tailwindcss-ls = { command = "tailwindcss-language-server", args = ["--stdio"] } taplo = { command = "taplo", args = ["lsp", "stdio"] } terraform-ls = { command = "terraform-ls", args = ["serve"] } texlab = { command = "texlab" } From 93e54fa0c88dc0c8761242b14b11a5aca79c6faf Mon Sep 17 00:00:00 2001 From: DS/Charlie <82801887+ds-cbo@users.noreply.github.com> Date: Sat, 7 Oct 2023 00:29:42 +0200 Subject: [PATCH 002/393] add support for json5 (#8473) * add json5 language * docgen --- book/src/generated/lang-support.md | 1 + languages.toml | 16 ++++++++++++++++ runtime/queries/json5/highlights.scm | 11 +++++++++++ 3 files changed, 28 insertions(+) create mode 100644 runtime/queries/json5/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index f65f268d0..378c6730e 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -76,6 +76,7 @@ | jinja | ✓ | | | | | jsdoc | ✓ | | | | | json | ✓ | | ✓ | `vscode-json-language-server` | +| json5 | ✓ | | | | | jsonnet | ✓ | | | `jsonnet-language-server` | | jsx | ✓ | ✓ | ✓ | `typescript-language-server` | | julia | ✓ | ✓ | ✓ | `julia` | diff --git a/languages.toml b/languages.toml index 8fafd5d43..6eab0421c 100644 --- a/languages.toml +++ b/languages.toml @@ -348,6 +348,22 @@ indent = { tab-width = 2, unit = " " } name = "json" source = { git = "https://github.com/tree-sitter/tree-sitter-json", rev = "73076754005a460947cafe8e03a8cf5fa4fa2938" } + +[[language]] +name = "json5" +scope = "source.json5" +injection-regex = "json5" +file-types = ["json5"] +roots = [] +language-servers = [] +comment-token = "//" +indent = { tab-width = 4, unit = " " } +# https://json5.org + +[[grammar]] +name = "json5" +source = { git = "https://github.com/Joakker/tree-sitter-json5", rev = "c23f7a9b1ee7d45f516496b1e0e4be067264fa0d" } + [[language]] name = "c" scope = "source.c" diff --git a/runtime/queries/json5/highlights.scm b/runtime/queries/json5/highlights.scm new file mode 100644 index 000000000..4bf03fe31 --- /dev/null +++ b/runtime/queries/json5/highlights.scm @@ -0,0 +1,11 @@ +(string) @string + +(identifier) @constant + +(number) @constant.numeric + +(null) @constant.builtin + +[(true) (false)] @constant.builtin.boolean + +(comment) @comment From bdf7937a599058daa168fa24b0f52c06d4259cf7 Mon Sep 17 00:00:00 2001 From: Laurent Wandrebeck Date: Sun, 8 Oct 2023 12:34:21 +0200 Subject: [PATCH 003/393] Add ansible-language-server for yaml (#7973) * Update languages.toml Add ansible support to yaml. * cargo xtask docgen --- book/src/generated/lang-support.md | 2 +- languages.toml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 378c6730e..a2c4ba97f 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -179,6 +179,6 @@ | wren | ✓ | ✓ | ✓ | | | xit | ✓ | | | | | xml | ✓ | | ✓ | | -| yaml | ✓ | | ✓ | `yaml-language-server` | +| yaml | ✓ | | ✓ | `yaml-language-server`, `ansible-language-server` | | yuck | ✓ | | | | | zig | ✓ | ✓ | ✓ | `zls` | diff --git a/languages.toml b/languages.toml index 6eab0421c..257d90afe 100644 --- a/languages.toml +++ b/languages.toml @@ -87,6 +87,9 @@ yaml-language-server = { command = "yaml-language-server", args = ["--stdio"] } zls = { command = "zls" } blueprint-compiler = { command = "blueprint-compiler", args = ["lsp"] } +[language-server.ansible-language-server] +command = "ansible-language-server" +args = ["--stdio"] [language-server.lua-language-server] command = "lua-language-server" @@ -1071,7 +1074,7 @@ file-types = ["yml", "yaml"] roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } -language-servers = [ "yaml-language-server" ] +language-servers = [ "yaml-language-server", "ansible-language-server" ] injection-regex = "yml|yaml" [[grammar]] From 96bbfb7c2e880c8ed0d7f3f15ee39fb5b68c93b4 Mon Sep 17 00:00:00 2001 From: DS/Charlie <82801887+ds-cbo@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:29:30 +0200 Subject: [PATCH 004/393] bump tree-sitter-sql (#8464) * bump tree-sitter-sql * update highlights classes to helix flavour * replace lua-match with match --- languages.toml | 2 +- runtime/queries/sql/highlights.scm | 510 ++++++++++++++++------------- 2 files changed, 280 insertions(+), 232 deletions(-) diff --git a/languages.toml b/languages.toml index 257d90afe..f0c27a0cf 100644 --- a/languages.toml +++ b/languages.toml @@ -1786,7 +1786,7 @@ injection-regex = "sql" [[grammar]] name = "sql" -source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "7cbac0472e5b8f8486ce64ffbcf1982d5cd5fc8d" } +source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "eeab7240a11098724e6f95bc57cc3ceaf5487d5f" } [[language]] name = "gdscript" diff --git a/runtime/queries/sql/highlights.scm b/runtime/queries/sql/highlights.scm index 2faa67ed3..1041cc2fc 100644 --- a/runtime/queries/sql/highlights.scm +++ b/runtime/queries/sql/highlights.scm @@ -1,134 +1,168 @@ +(invocation + (object_reference + name: (identifier) @function.method)) [ + (keyword_gist) (keyword_btree) (keyword_hash) - (keyword_gist) (keyword_spgist) (keyword_gin) (keyword_brin) - - (cast) - (group_concat) - (invocation) + (keyword_array) ] @function.builtin - -(table_reference - name: (identifier) @namespace) -(relation - table_alias: (identifier) @variable.parameter) - -(field +(object_reference name: (identifier) @variable.other.member) - + +(relation + alias: (identifier) @variable.parameter) + (field - table_alias: (identifier) @variable.parameter name: (identifier) @variable.other.member) -(comment) @comment +(term + alias: (identifier) @variable.parameter) -[ - "(" - ")" -] @punctuation.bracket +(term + value: (cast + name: (keyword_cast) @function.builtin + parameter: [(literal)]?)) -[ - ";" - "," - "." -] @punctuation.delimiter +(literal) @string +(comment) @comment.line +(marginalia) @comment.block -(binary_expression - operator: _ @operator) +((literal) @constant.numeric.integer + (#match? @constant.numeric.integer "^-?\\d+$")) -(unary_expression - operator: _ @operator) +((literal) @constant.numeric.float + (#match? @constant.numeric.float "^-?\\d*\\.\\d*$")) -(all_fields) @special +(parameter) @variable.parameter [ - (keyword_null) - (keyword_true) - (keyword_false) -] @constant.builtin + (keyword_true) + (keyword_false) +] @constant.builtin.boolean -((literal) @constant.numeric - (#match? @constant.numeric "^-?\\d*\\.?\\d*$")) +[ + (keyword_asc) + (keyword_desc) + (keyword_terminated) + (keyword_escaped) + (keyword_unsigned) + (keyword_nulls) + (keyword_last) + (keyword_delimited) + (keyword_replication) + (keyword_auto_increment) + (keyword_default) + (keyword_collate) + (keyword_concurrently) + (keyword_engine) + (keyword_always) + (keyword_generated) + (keyword_preceding) + (keyword_following) + (keyword_first) + (keyword_current_timestamp) + (keyword_immutable) + (keyword_atomic) + (keyword_parallel) + (keyword_leakproof) + (keyword_safe) + (keyword_cost) + (keyword_strict) +] @attribute -(literal) @string +[ + (keyword_materialized) + (keyword_recursive) + (keyword_temp) + (keyword_temporary) + (keyword_unlogged) + (keyword_external) + (keyword_parquet) + (keyword_csv) + (keyword_rcfile) + (keyword_textfile) + (keyword_orc) + (keyword_avro) + (keyword_jsonfile) + (keyword_sequencefile) + (keyword_volatile) +] @keyword.storage.type + +[ + (keyword_case) + (keyword_when) + (keyword_then) + (keyword_else) +] @keyword.control.conditional [ (keyword_select) + (keyword_from) + (keyword_where) + (keyword_index) + (keyword_join) + (keyword_primary) (keyword_delete) + (keyword_create) (keyword_insert) + (keyword_merge) + (keyword_distinct) (keyword_replace) (keyword_update) (keyword_into) (keyword_overwrite) + (keyword_matched) (keyword_values) + (keyword_value) + (keyword_attribute) (keyword_set) - (keyword_from) (keyword_left) (keyword_right) + (keyword_outer) (keyword_inner) (keyword_full) - (keyword_outer) - (keyword_cross) - (keyword_join) - (keyword_lateral) - (keyword_on) - (keyword_not) (keyword_order) - (keyword_group) (keyword_partition) - (keyword_by) + (keyword_group) + (keyword_with) + (keyword_as) (keyword_having) - (keyword_desc) - (keyword_asc) (keyword_limit) (keyword_offset) - (keyword_primary) - (keyword_create) - (keyword_alter) - (keyword_change) - (keyword_analyze) - (keyword_modify) - (keyword_drop) - (keyword_add) (keyword_table) (keyword_tables) - (keyword_view) - (keyword_materialized) - (keyword_column) (keyword_key) - (keyword_as) - (keyword_distinct) + (keyword_references) + (keyword_foreign) (keyword_constraint) - ; (keyword_cast) - ; (keyword_group_concat) - (keyword_separator) - (keyword_max) - (keyword_min) - (keyword_avg) - (keyword_end) (keyword_force) - (keyword_ignore) - (keyword_using) (keyword_use) - (keyword_index) (keyword_for) (keyword_if) (keyword_exists) - (keyword_auto_increment) - (keyword_generated) - (keyword_always) - (keyword_collate) - (keyword_character) - (keyword_engine) - (keyword_default) - (keyword_cascade) - (keyword_restrict) - (keyword_with) + (keyword_max) + (keyword_min) + (keyword_avg) + (keyword_column) + (keyword_columns) + (keyword_cross) + (keyword_lateral) + (keyword_natural) + (keyword_alter) + (keyword_drop) + (keyword_add) + (keyword_view) + (keyword_end) + (keyword_is) + (keyword_using) + (keyword_between) + (keyword_window) (keyword_no) (keyword_data) (keyword_type) @@ -136,208 +170,222 @@ (keyword_to) (keyword_schema) (keyword_owner) - (keyword_temp) - (keyword_temporary) - (keyword_unlogged) - (keyword_union) + (keyword_authorization) (keyword_all) (keyword_any) (keyword_some) - (keyword_except) - (keyword_intersect) (keyword_returning) (keyword_begin) (keyword_commit) (keyword_rollback) (keyword_transaction) + (keyword_only) + (keyword_like) + (keyword_similar) (keyword_over) - (keyword_nulls) - (keyword_first) + (keyword_change) + (keyword_modify) (keyword_after) - (keyword_last) - (keyword_window) + (keyword_before) (keyword_range) (keyword_rows) (keyword_groups) - (keyword_between) - (keyword_unbounded) - (keyword_preceding) - (keyword_following) (keyword_exclude) (keyword_current) - (keyword_row) (keyword_ties) (keyword_others) - (keyword_only) - (keyword_unique) - (keyword_foreign) - (keyword_references) - (keyword_concurrently) - ; (keyword_btree) - ; (keyword_hash) - ; (keyword_gist) - ; (keyword_spgist) - ; (keyword_gin) - ; (keyword_brin) - (keyword_like) - (keyword_similar) (keyword_preserve) - (keyword_unsigned) (keyword_zerofill) - (keyword_conflict) - (keyword_do) - (keyword_nothing) - (keyword_high_priority) - (keyword_low_priority) - (keyword_delayed) - (keyword_recursive) - (keyword_cascaded) - (keyword_local) - (keyword_current_timestamp) - (keyword_check) - (keyword_option) + (keyword_format) + (keyword_fields) + (keyword_row) + (keyword_sort) + (keyword_compute) + (keyword_comment) + (keyword_location) + (keyword_cached) + (keyword_uncached) + (keyword_lines) + (keyword_stored) + (keyword_virtual) + (keyword_partitioned) + (keyword_analyze) + (keyword_explain) + (keyword_verbose) + (keyword_truncate) + (keyword_rewrite) + (keyword_optimize) (keyword_vacuum) - (keyword_wait) - (keyword_nowait) - - (keyword_trigger) - (keyword_function) - (keyword_returns) - (keyword_return) - (keyword_setof) - (keyword_atomic) - (keyword_declare) - ; (keyword_language) + (keyword_cache) + (keyword_language) (keyword_sql) + (keyword_called) + (keyword_conflict) + (keyword_declare) + (keyword_filter) + (keyword_function) + (keyword_input) + (keyword_name) + (keyword_oid) + (keyword_options) (keyword_plpgsql) - (keyword_immutable) - (keyword_stable) - (keyword_volatile) - (keyword_leakproof) - (keyword_parallel) - (keyword_safe) - (keyword_unsafe) + (keyword_precision) + (keyword_regclass) + (keyword_regnamespace) + (keyword_regproc) + (keyword_regtype) (keyword_restricted) - (keyword_called) + (keyword_return) (keyword_returns) - (keyword_input) - (keyword_strict) - (keyword_cost) - (keyword_rows) + (keyword_separator) + (keyword_setof) + (keyword_stable) (keyword_support) - - (keyword_external) - (keyword_stored) - (keyword_cached) - (keyword_uncached) - (keyword_replication) (keyword_tblproperties) - (keyword_options) - (keyword_compute) - (keyword_stats) - (keyword_statistics) - (keyword_optimize) - (keyword_rewrite) - (keyword_bin_pack) - (keyword_incremental) - (keyword_location) - (keyword_partitioned) - (keyword_comment) - (keyword_sort) - (keyword_format) - (keyword_delimited) - (keyword_fields) - (keyword_terminated) - (keyword_escaped) - (keyword_lines) - (keyword_cache) - (keyword_metadata) - (keyword_noscan) - - (keyword_parquet) - (keyword_rcfile) - (keyword_csv) - (keyword_textfile) - (keyword_avro) - (keyword_sequencefile) - (keyword_orc) - (keyword_avro) - (keyword_jsonfile) - - (keyword_precision) - (keyword_inet) + (keyword_trigger) + (keyword_unsafe) + (keyword_admin) + (keyword_connection) + (keyword_cycle) + (keyword_database) + (keyword_encrypted) + (keyword_increment) + (keyword_logged) + (keyword_none) + (keyword_owned) + (keyword_password) + (keyword_reset) + (keyword_role) + (keyword_sequence) + (keyword_start) + (keyword_restart) + (keyword_tablespace) + (keyword_until) + (keyword_user) + (keyword_valid) + (keyword_action) ] @keyword [ - (keyword_case) - (keyword_when) - (keyword_then) - (keyword_else) - (keyword_where) -] @keyword.control.conditional - -[ - (keyword_in) - (keyword_and) - (keyword_or) - (keyword_is) -] @keyword.operator + (keyword_restrict) + (keyword_unbounded) + (keyword_unique) + (keyword_cascade) + (keyword_delayed) + (keyword_high_priority) + (keyword_low_priority) + (keyword_ignore) + (keyword_nothing) + (keyword_check) + (keyword_option) + (keyword_local) + (keyword_cascaded) + (keyword_wait) + (keyword_nowait) + (keyword_metadata) + (keyword_incremental) + (keyword_bin_pack) + (keyword_noscan) + (keyword_stats) + (keyword_statistics) + (keyword_maxvalue) + (keyword_minvalue) +] @keyword [ + (keyword_int) + (keyword_null) (keyword_boolean) - (bit) (keyword_binary) - + (keyword_varbinary) + (keyword_image) + (keyword_bit) + (keyword_inet) + (keyword_character) (keyword_smallserial) (keyword_serial) (keyword_bigserial) - - (tinyint) - (smallint) - (mediumint) - (int) - (bigint) - (decimal) - (numeric) + (keyword_smallint) + (keyword_mediumint) + (keyword_bigint) + (keyword_tinyint) + (keyword_decimal) + (keyword_float) + (keyword_double) + (keyword_numeric) (keyword_real) (double) - (float) - (keyword_money) - - (char) - (varchar) - (numeric) - (keyword_string) + (keyword_smallmoney) + (keyword_char) + (keyword_nchar) + (keyword_varchar) + (keyword_nvarchar) + (keyword_varying) (keyword_text) - + (keyword_string) (keyword_uuid) - (keyword_json) (keyword_jsonb) (keyword_xml) - (keyword_bytea) - (keyword_inet) - - (enum) - + (keyword_enum) (keyword_date) (keyword_datetime) + (keyword_time) + (keyword_datetime2) + (keyword_datetimeoffset) + (keyword_smalldatetime) (keyword_timestamp) (keyword_timestamptz) - - (keyword_interval) - (keyword_geometry) (keyword_geography) (keyword_box2d) (keyword_box3d) - - (keyword_oid) - (keyword_name) - (keyword_regclass) - (keyword_regnamespace) - (keyword_regproc) - (keyword_regtype) + (keyword_interval) ] @type.builtin + +[ + (keyword_in) + (keyword_and) + (keyword_or) + (keyword_not) + (keyword_by) + (keyword_on) + (keyword_do) + (keyword_union) + (keyword_except) + (keyword_intersect) +] @keyword.operator + +[ + "+" + "-" + "*" + "/" + "%" + "^" + ":=" + "=" + "<" + "<=" + "!=" + ">=" + ">" + "<>" + "->" + "->>" + "#>" + "#>>" +] @operator + +[ + "(" + ")" +] @punctuation.bracket + +[ + ";" + "," + "." +] @punctuation.delimiter From 5cb76e74f9bd226f1b4757f478bf49873d9ecfe6 Mon Sep 17 00:00:00 2001 From: Kasper Juul Hermansen Date: Mon, 9 Oct 2023 17:30:27 +0200 Subject: [PATCH 005/393] add lsp for graphql (#8492) graphql-lsp has quite the strange name upstream, the project is technically called graphql-language-service, but the binary shipped is called graphql-lsp hence the strange naming scheme Signed-off-by: kjuulh --- book/src/generated/lang-support.md | 2 +- languages.toml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index a2c4ba97f..429f54f55 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -59,7 +59,7 @@ | gomod | ✓ | | | `gopls` | | gotmpl | ✓ | | | `gopls` | | gowork | ✓ | | | `gopls` | -| graphql | ✓ | | | | +| graphql | ✓ | | | `graphql-lsp` | | hare | ✓ | | | | | haskell | ✓ | ✓ | | `haskell-language-server-wrapper` | | haskell-persistent | ✓ | | | | diff --git a/languages.toml b/languages.toml index f0c27a0cf..24b6cccf9 100644 --- a/languages.toml +++ b/languages.toml @@ -30,6 +30,7 @@ forth-lsp = { command = "forth-lsp" } fortls = { command = "fortls", args = ["--lowercase_intrinsics"] } fsharp-ls = { command = "fsautocomplete", config = { AutomaticWorkspaceInit = true } } gleam = { command = "gleam", args = ["lsp"] } +graphql-language-service = { command = "graphql-lsp", args = ["server", "-m", "stream"] } haskell-language-server = { command = "haskell-language-server-wrapper", args = ["--lsp"] } idris2-lsp = { command = "idris2-lsp" } intelephense = { command = "intelephense", args = ["--stdio"] } @@ -1513,6 +1514,7 @@ scope = "source.graphql" injection-regex = "graphql" file-types = ["gql", "graphql", "graphqls"] roots = [] +language-servers = [ "graphql-language-service" ] indent = { tab-width = 2, unit = " " } [[grammar]] From a8574805617d86304232b47d84fd7c7f4f773520 Mon Sep 17 00:00:00 2001 From: Bjorn Ove Hay Andersen Date: Mon, 9 Oct 2023 18:38:09 +0200 Subject: [PATCH 006/393] Set the working directory before loading the config (#8498) --- helix-loader/src/lib.rs | 6 +++--- helix-term/src/application.rs | 5 +---- helix-term/src/main.rs | 8 ++++++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index 7ff4cada7..82ed2edea 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -33,9 +33,9 @@ pub fn current_working_dir() -> PathBuf { path } -pub fn set_current_working_dir(path: PathBuf) -> std::io::Result<()> { +pub fn set_current_working_dir(path: impl AsRef) -> std::io::Result<()> { let path = dunce::canonicalize(path)?; - std::env::set_current_dir(path.clone())?; + std::env::set_current_dir(&path)?; let mut cwd = CWD.write().unwrap(); *cwd = Some(path); Ok(()) @@ -280,7 +280,7 @@ mod merge_toml_tests { let cwd = current_working_dir(); assert_ne!(cwd, new_path); - set_current_working_dir(new_path.clone()).expect("Couldn't set new path"); + set_current_working_dir(&new_path).expect("Couldn't set new path"); let cwd = current_working_dir(); assert_eq!(cwd, new_path); diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 7c23ddfe2..fabd0fa4d 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -156,9 +156,6 @@ impl Application { let editor_view = Box::new(ui::EditorView::new(Keymaps::new(keys))); compositor.push(editor_view); - if let Some(path) = args.working_directory { - helix_loader::set_current_working_dir(path)? - } if args.load_tutor { let path = helix_loader::runtime_file(Path::new("tutor")); editor.open(&path, Action::VerticalSplit)?; @@ -167,7 +164,7 @@ impl Application { } else if !args.files.is_empty() { let first = &args.files[0].0; // we know it's not empty if first.is_dir() { - helix_loader::set_current_working_dir(first.clone())?; + // NOTE: The working directory is already set to args.files[0] in main() editor.new_file(Action::VerticalSplit); let picker = ui::file_picker(".".into(), &config.load().editor); compositor.push(Box::new(overlaid(picker))); diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index 009cbf7f4..ed3478ac9 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -115,6 +115,14 @@ FLAGS: setup_logging(args.verbosity).context("failed to initialize logging")?; + // NOTE: Set the working directory early so the correct configuration is loaded. Be aware that + // Application::new() depends on this logic so it must be updated if this changes. + if let Some((path, true)) = args.files.first().map(|(path, _)| (path, path.is_dir())) { + helix_loader::set_current_working_dir(path)?; + } else if let Some(path) = &args.working_directory { + helix_loader::set_current_working_dir(path)?; + } + let config = match Config::load_default() { Ok(config) => config, Err(ConfigLoadError::Error(err)) if err.kind() == std::io::ErrorKind::NotFound => { From e0d5b79a73b2faf807b934fbb145d003df575b84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:46:51 +0900 Subject: [PATCH 007/393] build(deps): bump hashbrown from 0.14.0 to 0.14.1 (#8500) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- helix-core/Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee09c8e0c..8a05415d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -847,7 +847,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e133bc56d938eaec1c675af7c681a51de9662b0ada779f45607b967a10da77a" dependencies = [ "gix-hash", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "parking_lot", ] @@ -1250,9 +1250,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" dependencies = [ "ahash", "allocator-api2", @@ -1269,7 +1269,7 @@ dependencies = [ "dunce", "encoding_rs", "etcetera", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "helix-loader", "imara-diff", "indoc", @@ -1564,7 +1564,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 912342438..fb4894137 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -31,7 +31,7 @@ arc-swap = "1" regex = "1" bitflags = "2.4" ahash = "0.8.3" -hashbrown = { version = "0.14.0", features = ["raw"] } +hashbrown = { version = "0.14.1", features = ["raw"] } dunce = "1.0" log = "0.4" From ca0382b75bc70f3122bfcef5abdc90229182d3b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:47:04 +0900 Subject: [PATCH 008/393] build(deps): bump tokio from 1.32.0 to 1.33.0 (#8501) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- helix-lsp/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a05415d6..ecad9ab1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2407,9 +2407,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes", diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml index 19bc94d6e..0b181a845 100644 --- a/helix-lsp/Cargo.toml +++ b/helix-lsp/Cargo.toml @@ -25,7 +25,7 @@ lsp-types = { version = "0.94" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" -tokio = { version = "1.32", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] } +tokio = { version = "1.33", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] } tokio-stream = "0.1.14" which = "4.4" parking_lot = "0.12.1" From d8f059cbcc0de7c4aec68d1c1f1538d0c50acc1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:47:15 +0900 Subject: [PATCH 009/393] build(deps): bump rustix from 0.38.15 to 0.38.18 (#8502) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ecad9ab1f..cea0f4858 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1455,7 +1455,7 @@ dependencies = [ "log", "once_cell", "parking_lot", - "rustix 0.38.15", + "rustix 0.38.18", "serde", "serde_json", "slotmap", @@ -1657,9 +1657,9 @@ checksum = "36eb31c1778188ae1e64398743890d0877fef36d11521ac60406b42016e8c2cf" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" @@ -2052,14 +2052,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.15" +version = "0.38.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" +checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] @@ -2289,7 +2289,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.38.15", + "rustix 0.38.18", "windows-sys 0.48.0", ] @@ -2646,7 +2646,7 @@ dependencies = [ "dirs", "either", "once_cell", - "rustix 0.38.15", + "rustix 0.38.18", ] [[package]] From 1852292451d984de33ea526b3b7dc7f51c6130eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:47:25 +0900 Subject: [PATCH 010/393] build(deps): bump libc from 0.2.148 to 0.2.149 (#8503) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- helix-term/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cea0f4858..38d39f498 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1626,9 +1626,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 878dcd1f9..72ddf360c 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -69,7 +69,7 @@ grep-searcher = "0.1.11" [target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100 signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } -libc = "0.2.148" +libc = "0.2.149" [target.'cfg(target_os = "macos")'.dependencies] crossterm = { version = "0.27", features = ["event-stream", "use-dev-tty"] } From 07a006d1d5270e81c57bbc0e712614741d3b31a7 Mon Sep 17 00:00:00 2001 From: Bjorn Ove Hay Andersen Date: Thu, 12 Oct 2023 10:35:43 +0200 Subject: [PATCH 011/393] Add +N CLI argument to jump to first file's line number (#8521) * Accept +num flag for opening at line number * Update +N argument feature according to feedback in original PR #5603 * Only override the line number of the first file if +N is specified --------- Co-authored-by: Nachum Barcohen <38861757+nabaco@users.noreply.github.com> --- helix-term/src/args.rs | 14 ++++++++++++++ helix-term/src/main.rs | 1 + 2 files changed, 15 insertions(+) diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index f782539ca..6a49889b6 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -24,6 +24,7 @@ impl Args { pub fn parse_args() -> Result { let mut args = Args::default(); let mut argv = std::env::args().peekable(); + let mut line_number = 0; argv.next(); // skip the program, we don't care about that @@ -88,6 +89,13 @@ impl Args { } } } + arg if arg.starts_with('+') => { + let arg = &arg[1..]; + line_number = match arg.parse::() { + Ok(n) => n.saturating_sub(1), + _ => anyhow::bail!("bad line number after +"), + }; + } arg => args.files.push(parse_file(arg)), } } @@ -97,6 +105,12 @@ impl Args { args.files.push(parse_file(&arg)); } + if let Some(file) = args.files.first_mut() { + if line_number != 0 { + file.1.row = line_number; + } + } + Ok(args) } } diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index ed3478ac9..8db5f3100 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -67,6 +67,7 @@ FLAGS: --vsplit Splits all given files vertically into different windows --hsplit Splits all given files horizontally into different windows -w, --working-dir Specify an initial working directory + +N Open the first given file at line number N ", env!("CARGO_PKG_NAME"), VERSION_AND_GIT_HASH, From 574f82130892d4a388bfdcce63fe2c4a190e479e Mon Sep 17 00:00:00 2001 From: Bjorn Ove Hay Andersen Date: Thu, 12 Oct 2023 14:09:57 +0200 Subject: [PATCH 012/393] Make parse_macro work for "-" outside "<..>" (#8475) * Translate to when a part of the outher string in * Changed the if a little --- helix-view/src/input.rs | 60 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/helix-view/src/input.rs b/helix-view/src/input.rs index 87a0bfcaa..0f4ffaacf 100644 --- a/helix-view/src/input.rs +++ b/helix-view/src/input.rs @@ -549,7 +549,7 @@ pub fn parse_macro(keys_str: &str) -> anyhow::Result> { if c == ">" { keys_res = Err(anyhow!("Unmatched '>'")); } else if c != "<" { - keys.push(c); + keys.push(if c == "-" { keys::MINUS } else { c }); i += end_i; } else { match s.find('>').context("'>' expected") { @@ -813,6 +813,64 @@ mod test { }, ]) ); + + assert_eq!( + parse_macro(":w aa-bb.txt").ok(), + Some(vec![ + KeyEvent { + code: KeyCode::Char(':'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('w'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char(' '), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('a'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('a'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('-'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('b'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('b'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('.'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('t'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('x'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Char('t'), + modifiers: KeyModifiers::NONE, + }, + KeyEvent { + code: KeyCode::Enter, + modifiers: KeyModifiers::NONE, + }, + ]) + ); } #[test] From 1ef7f24daec1602e39ea9b01b0e1a50fc6623155 Mon Sep 17 00:00:00 2001 From: NomisIV <47303199+NomisIV@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:08:27 +0200 Subject: [PATCH 013/393] Update purescript-tree-sitter grammar (#8527) --- languages.toml | 2 +- runtime/queries/purescript/highlights.scm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 24b6cccf9..048c76bb4 100644 --- a/languages.toml +++ b/languages.toml @@ -1122,7 +1122,7 @@ formatter = { command = "purs-tidy", args = ["format"] } [[grammar]] name = "purescript" -source = { git = "https://github.com/maskhjarna/tree-sitter-purescript", rev = "5f5a030826849b7be17596d372967f60051b42bd" } +source = { git = "https://github.com/maskhjarna/tree-sitter-purescript", rev = "0e36a885a941078bf40e559026be425764dc27bf" } [[language]] name = "zig" diff --git a/runtime/queries/purescript/highlights.scm b/runtime/queries/purescript/highlights.scm index 86deb48f6..f559fd1ea 100644 --- a/runtime/queries/purescript/highlights.scm +++ b/runtime/queries/purescript/highlights.scm @@ -5,7 +5,10 @@ (exp_negation) @constant.numeric.integer (exp_literal (float)) @constant.numeric.float (char) @constant.character - (string) @string + [ + (string) + (triple_quote_string) + ] @string (con_unit) @constant.builtin ; unit, as in () From 9f6e9a151228c3c95cddb9032849625883d2ac8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Gajd=C5=AF=C5=A1ek?= Date: Fri, 13 Oct 2023 17:08:56 +0200 Subject: [PATCH 014/393] Add 'while_statement' to bash indents (#8528) --- runtime/queries/bash/indents.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/queries/bash/indents.scm b/runtime/queries/bash/indents.scm index f2077037d..7dbf46c54 100644 --- a/runtime/queries/bash/indents.scm +++ b/runtime/queries/bash/indents.scm @@ -2,6 +2,7 @@ (function_definition) (if_statement) (for_statement) + (while_statement) (case_statement) (pipeline) ] @indent From c6854e5135e4547ee3cad838bc7aa584af0f82f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 00:03:36 +0000 Subject: [PATCH 015/393] build(deps): bump gix from 0.48.0 to 0.51.0 Bumps [gix](https://github.com/Byron/gitoxide) from 0.48.0 to 0.51.0. - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.48.0...gix-v0.51.0) --- updated-dependencies: - dependency-name: gix dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 334 +++++++++++++++++++++++++------------------ helix-vcs/Cargo.toml | 2 +- 2 files changed, 194 insertions(+), 142 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38d39f498..d4ec67abc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -366,6 +366,15 @@ dependencies = [ "syn 2.0.28", ] +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] + [[package]] name = "dirs" version = "5.0.1" @@ -465,6 +474,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "faster-hex" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239f7bfb930f820ab16a9cd95afc26f88264cf6905c960b340a615384aa3338a" +dependencies = [ + "serde", +] + [[package]] name = "fastrand" version = "2.0.0" @@ -583,9 +601,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.48.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e74cea676de7f53a79f3c0365812b11f6814b81e671b8ee4abae6ca09c7881" +checksum = "4ce5c049b1afcae9bb9e10c0f6dd8eb1335e8647fb7fd34732a66133ca3b9886" dependencies = [ "gix-actor", "gix-attributes", @@ -595,8 +613,9 @@ dependencies = [ "gix-date", "gix-diff", "gix-discover", - "gix-features", - "gix-fs", + "gix-features 0.32.1", + "gix-filter", + "gix-fs 0.4.1", "gix-glob", "gix-hash", "gix-hashtable", @@ -631,9 +650,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.23.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1969b77b9ee4cc1755c841987ec6f7622aaca95e952bcafb76973ae59d1b8716" +checksum = "abd2566c12095a584716f2c16f051850bd8987f57556f1fef4a7cce0300b83d0" dependencies = [ "bstr", "btoi", @@ -645,9 +664,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.14.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3772b0129dcd1fc73e985bbd08a1482d082097d2915cb1ee31ce8092b8e4434" +checksum = "63a134a674e39e238bd273326a9815296cc71f867ad5466518da71392cff98ce" dependencies = [ "bstr", "gix-glob", @@ -662,40 +681,40 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311e2fa997be6560c564b070c5da2d56d038b645a94e1e5796d5d85a350da33c" +checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39db5ed0fc0a2e9b1b8265993f7efdbc30379dec268f3b91b7af0c2de4672fdd" +checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.2.6" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb49ab557a37b0abb2415bca2b10e541277dff0565deb5bd5e99fd95f93f51eb" +checksum = "3c576cfbf577f72c097b5f88aedea502cd62952bdc1fb3adcab4531d5525a4c7" dependencies = [ "bstr", ] [[package]] name = "gix-commitgraph" -version = "0.17.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed42baa50075d41c1a0931074ce1a97c5797c7c6fe7591d9f1f2dcd448532c26" +checksum = "8219fe6f39588a29dbfb8d1c244b07ee653126edc5b6f3860752c3b5454fa10b" dependencies = [ "bstr", "gix-chunk", - "gix-features", + "gix-features 0.32.1", "gix-hash", "memmap2 0.7.1", "thiserror", @@ -703,31 +722,31 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.25.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "817688c7005a716d9363e267913526adea402dabd947f4ba63842d10cc5132af" +checksum = "2135b921a699a4c36167148193bea23c653a16ef0686f6a280e383469709a773" dependencies = [ "bstr", "gix-config-value", - "gix-features", + "gix-features 0.32.1", "gix-glob", "gix-path", "gix-ref", "gix-sec", "log", "memchr", - "nom", "once_cell", "smallvec", "thiserror", "unicode-bom", + "winnow 0.5.17", ] [[package]] name = "gix-config-value" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83960be5e99266bcf55dae5a24731bbd39f643bfb68f27e939d6b06836b5b87d" +checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" dependencies = [ "bitflags 2.4.0", "bstr", @@ -738,9 +757,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a75565e0e6e7f80cfa4eb1b05cc448c6846ddd48dcf413a28875fbc11ee9af" +checksum = "307d91ec5f7c8e9bfaa217fe30c2e0099101cbe83dbed27a222dbb6def38725f" dependencies = [ "bstr", "gix-command", @@ -754,9 +773,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.7.0" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9a04a1d2387c955ec91059d56b673000dd24f3c07cad08ed253e36381782bf" +checksum = "0a825babda995d788e30d306a49dacd1e93d5f5d33d53c7682d0347cef40333c" dependencies = [ "bstr", "itoa", @@ -766,9 +785,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.32.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf5d9b9b521b284ebe53ee69eee33341835ec70edc314f36b2100ea81396121" +checksum = "9a49d7a9a9ed5ec3428c3061da45d0fc5f50b3c07b91ea4e7ec4959668f25f6c" dependencies = [ "gix-hash", "gix-object", @@ -778,9 +797,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.21.1" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "272aad20dc63dedba76615373dd8885fb5aebe4795e5b5b0aa2a24e63c82085c" +checksum = "041480eb03d8aa0894d9b73d25d182d51bc4d0ea8925a6ee0c971262bbc7715e" dependencies = [ "bstr", "dunce", @@ -796,6 +815,17 @@ name = "gix-features" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06142d8cff5d17509399b04052b64d2f9b3a311d5cff0b1a32b220f62cd0d595" +dependencies = [ + "gix-hash", + "gix-trace", + "libc", +] + +[[package]] +name = "gix-features" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882695cccf38da4c3cc7ee687bdb412cf25e37932d7f8f2c306112ea712449f1" dependencies = [ "crc32fast", "flate2", @@ -809,32 +839,61 @@ dependencies = [ "walkdir", ] +[[package]] +name = "gix-filter" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4d4d61f2ab07de4612f8e078d7f1a443c7ab5c40f382784c8eacdf0fd172b9" +dependencies = [ + "bstr", + "encoding_rs", + "gix-attributes", + "gix-command", + "gix-hash", + "gix-object", + "gix-packetline-blocking", + "gix-path", + "gix-quote", + "gix-trace", + "smallvec", + "thiserror", +] + [[package]] name = "gix-fs" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb15956bc0256594c62a2399fcf6958a02a11724217eddfdc2b49b21b6292496" dependencies = [ - "gix-features", + "gix-features 0.31.1", +] + +[[package]] +name = "gix-fs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d5b6e9d34a2c61ea4a02bbca94c409ab6dbbca1348cbb67298cd7fed8758761" +dependencies = [ + "gix-features 0.32.1", ] [[package]] name = "gix-glob" -version = "0.9.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c18bdff83143d61e7d60da6183b87542a870d026b2a2d0b30170b8e9c0cd321a" +checksum = "b7255c717f49a556fa5029f6d9f2b3c008b4dd016c87f23c2ab8ca9636d5fade" dependencies = [ "bitflags 2.4.0", "bstr", - "gix-features", + "gix-features 0.32.1", "gix-path", ] [[package]] name = "gix-hash" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0dd58cdbe7ffa4032fc111864c80d5f8cecd9a2c9736c97ae7e5be834188272" +checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" dependencies = [ "hex", "thiserror", @@ -842,9 +901,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e133bc56d938eaec1c675af7c681a51de9662b0ada779f45607b967a10da77a" +checksum = "385f4ce6ecf3692d313ca3aa9bd3b3d8490de53368d6d94bedff3af8b6d9c58d" dependencies = [ "gix-hash", "hashbrown 0.14.1", @@ -853,9 +912,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca801f2d0535210f77b33e2c067d565aedecacc82f1b3dbce26da1388ebc4634" +checksum = "a88b95ceb3bc45abcab6eb55ef4e0053e58b4df0712d3f9aec7d0ca990952603" dependencies = [ "bstr", "gix-glob", @@ -865,16 +924,17 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68099abdf6ee50ae3c897e8b05de96871cbe54d52a37cdf559101f911b883562" +checksum = "732f61ec71576bd443a3c24f4716dc7eac180d8929e7bb8603c7310161507106" dependencies = [ "bitflags 2.4.0", "bstr", "btoi", "filetime", "gix-bitmap", - "gix-features", + "gix-features 0.32.1", + "gix-fs 0.4.1", "gix-hash", "gix-lock", "gix-object", @@ -898,9 +958,9 @@ dependencies = [ [[package]] name = "gix-mailmap" -version = "0.15.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1787e3c37fc43b1f7c0e3be6196c6837b3ba5f869190dfeaa444b816f0a7f34b" +checksum = "7fc0dbbf35d29639770af68d7ff55924d83786c8924b0e6a1766af1a98b7d58b" dependencies = [ "bstr", "gix-actor", @@ -910,9 +970,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7bce64d4452dd609f44d04b14b29da2e0ad2c45fcdf4ce1472a5f5f8ec21c2" +checksum = "ce0061b7ae867e830c77b1ecfc5875f0d042aebb3d7e6014d04fd86ca6c71d59" dependencies = [ "bitflags 2.4.0", "gix-commitgraph", @@ -926,15 +986,15 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.32.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953f3d7ffad16734aa3ab1d05807972c80e339d1bd9dde03e0198716b99e2a6" +checksum = "bfdd87520c71a19afecfa616863a4b761621074878f5a3999243b3e37e233943" dependencies = [ "bstr", "btoi", "gix-actor", "gix-date", - "gix-features", + "gix-features 0.32.1", "gix-hash", "gix-validate", "hex", @@ -946,13 +1006,13 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.49.1" +version = "0.50.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6418cff00ecc2713b58c8e04bff30dda808fbba1a080e7248b299d069894a01" +checksum = "e827dbda6d3dabadb94cd437d0e0fe8c314a60d136a3235fc6f5bf7b96b976ac" dependencies = [ "arc-swap", "gix-date", - "gix-features", + "gix-features 0.32.1", "gix-hash", "gix-object", "gix-pack", @@ -965,14 +1025,14 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.39.1" +version = "0.40.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414935138d90043ea5898de7a93f02c2558e52652492719470e203ef26a8fd0a" +checksum = "46f029a4dce9ac91da35c968c3abdcae573b3e52c123be86cbab3011599de533" dependencies = [ "clru", "gix-chunk", "gix-diff", - "gix-features", + "gix-features 0.32.1", "gix-hash", "gix-hashtable", "gix-object", @@ -985,11 +1045,22 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gix-packetline-blocking" +version = "0.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d8395f7501c84d6a1fe902035fdfd8cd86d89e2dd6be0200ec1a72fd3c92d39" +dependencies = [ + "bstr", + "faster-hex", + "thiserror", +] + [[package]] name = "gix-path" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfca182d2575ded2ed38280f1ebf75cd5d3790b77e0872de07854cf085821fbe" +checksum = "18609c8cbec8508ea97c64938c33cd305b75dfc04a78d0c3b78b8b3fd618a77c" dependencies = [ "bstr", "gix-trace", @@ -1000,22 +1071,22 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.5.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dfd363fd89a40c1e7bff9c9c1b136cd2002480f724b0c627c1bc771cd5480ec" +checksum = "2c22decaf4a063ccae2b2108820c8630c01bd6756656df3fe464b32b8958a5ea" dependencies = [ "gix-command", "gix-config-value", "parking_lot", - "rustix 0.37.15", + "rustix", "thiserror", ] [[package]] name = "gix-quote" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3874de636c2526de26a3405b8024b23ef1a327bebf4845d770d00d48700b6a40" +checksum = "475c86a97dd0127ba4465fbb239abac9ea10e68301470c9791a6dd5351cdc905" dependencies = [ "bstr", "btoi", @@ -1024,14 +1095,14 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.32.1" +version = "0.33.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39453f4e5f23cddc2e6e4cca2ba20adfdbec29379e3ca829714dfe98ae068ccd" +checksum = "25db11edd78bf33043d1969fff51c567a4b30edd77ab44f6f8eb460a4c14985d" dependencies = [ "gix-actor", "gix-date", - "gix-features", - "gix-fs", + "gix-features 0.32.1", + "gix-fs 0.4.1", "gix-hash", "gix-lock", "gix-object", @@ -1045,9 +1116,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e76ff1f82fba295a121e31ab02f69642994e532c45c0c899aa393f4b740302" +checksum = "d19a02bf740b326d6c082a7d6f754ebe56eef900986c5e91be7cf000df9ea18d" dependencies = [ "bstr", "gix-hash", @@ -1059,9 +1130,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237428a7d3978e8572964e1e45d984027c2acc94df47e594baa6c4b0da7c9922" +checksum = "38a13500890435e3b9e7746bceda248646bfc69e259210884c98e29bb7a1aa6f" dependencies = [ "bstr", "gix-date", @@ -1074,9 +1145,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028d50fcaf8326a8f79a359490d9ca9fb4e2b51ac9ac86503560d0bcc888d2eb" +checksum = "71d4cbaf3cfbfde2b81b5ee8b469aff42c34693ce0fe17fc3c244d5085307f2c" dependencies = [ "gix-commitgraph", "gix-date", @@ -1089,9 +1160,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede298863db2a0574a14070991710551e76d1f47c9783b62d4fcbca17f56371c" +checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" dependencies = [ "bitflags 2.4.0", "gix-path", @@ -1105,7 +1176,7 @@ version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fac8310c17406ea619af72f42ee46dac795110f68f41b4f4fa231b69889c6a2" dependencies = [ - "gix-fs", + "gix-fs 0.3.0", "libc", "once_cell", "parking_lot", @@ -1116,15 +1187,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "103eac621617be3ebe0605c9065ca51a223279a23218aaf67d10daa6e452f663" +checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-traverse" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3cdfd54598db4fae57d5ae6f52958422b2d13382d2745796bfe5c8015ffa86e" +checksum = "e12e0fe428394226c37dd686ad64b09a04b569fe157d638b125b4a4c1e7e2df0" dependencies = [ "gix-commitgraph", "gix-date", @@ -1138,12 +1209,12 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.20.1" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beaede6dbc83f408b19adfd95bb52f1dbf01fb8862c3faf6c6243e2e67fcdfa1" +checksum = "4411bdbd1d46b35ae50e84c191660d437f89974e4236627785024be0b577170a" dependencies = [ "bstr", - "gix-features", + "gix-features 0.32.1", "gix-path", "home", "thiserror", @@ -1152,18 +1223,18 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7058c94f4164fcf5b8457d35f6d8f6e1007f9f7f938c9c7684a7e01d23c6ddde" +checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" dependencies = [ "fastrand", ] [[package]] name = "gix-validate" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d092b594c8af00a3a31fe526d363ee8a51a6f29d8496cdb991ed2f01ec0ec13" +checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" dependencies = [ "bstr", "thiserror", @@ -1171,15 +1242,16 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.21.1" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1363b9aa66b9e14412ac04e1f759827203f491729d92172535a8ce6cde02efa" +checksum = "9f8bb6dd57dc6c9dfa03cc2cf2cc0942edae405eb6dfd1c34dbd2be00a90cab2" dependencies = [ "bstr", "filetime", "gix-attributes", - "gix-features", - "gix-fs", + "gix-features 0.32.1", + "gix-filter", + "gix-fs 0.4.1", "gix-glob", "gix-hash", "gix-ignore", @@ -1455,7 +1527,7 @@ dependencies = [ "log", "once_cell", "parking_lot", - "rustix 0.38.18", + "rustix", "serde", "serde_json", "slotmap", @@ -1475,12 +1547,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - [[package]] name = "hex" version = "0.4.3" @@ -1583,17 +1649,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "io-lifetimes" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi 0.3.2", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "itoa" version = "1.0.6" @@ -1649,12 +1704,6 @@ dependencies = [ "cc", ] -[[package]] -name = "linux-raw-sys" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36eb31c1778188ae1e64398743890d0877fef36d11521ac60406b42016e8c2cf" - [[package]] name = "linux-raw-sys" version = "0.4.10" @@ -1797,7 +1846,7 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] @@ -1872,6 +1921,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro2" version = "1.0.63" @@ -2036,20 +2091,6 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustix" -version = "0.37.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0661814f891c57c930a610266415528da53c4933e6dea5fb350cbfe048a9ece" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.4", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.18" @@ -2059,7 +2100,7 @@ dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.10", + "linux-raw-sys", "windows-sys 0.48.0", ] @@ -2289,7 +2330,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.38.18", + "rustix", "windows-sys 0.48.0", ] @@ -2363,13 +2404,15 @@ dependencies = [ [[package]] name = "time" -version = "0.3.20" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ + "deranged", "itoa", "libc", "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -2377,15 +2420,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -2477,7 +2520,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.4.6", ] [[package]] @@ -2646,7 +2689,7 @@ dependencies = [ "dirs", "either", "once_cell", - "rustix 0.38.18", + "rustix", ] [[package]] @@ -2830,6 +2873,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +dependencies = [ + "memchr", +] + [[package]] name = "xtask" version = "0.6.0" diff --git a/helix-vcs/Cargo.toml b/helix-vcs/Cargo.toml index 1b6cd0635..edb6291c9 100644 --- a/helix-vcs/Cargo.toml +++ b/helix-vcs/Cargo.toml @@ -18,7 +18,7 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "p parking_lot = "0.12" arc-swap = { version = "1.6.0" } -gix = { version = "0.48.0", default-features = false , optional = true } +gix = { version = "0.55.0", default-features = false , optional = true } imara-diff = "0.1.5" anyhow = "1" From a6ab062b2dad0da41613113bce7b98353e5de104 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 8 Aug 2023 18:12:14 -0500 Subject: [PATCH 016/393] Re-lock 'time' dep at 0.3.23 Co-authored-by: Gabriel Dinner-David --- Cargo.lock | 451 +++++++++++------------------------------------------ 1 file changed, 89 insertions(+), 362 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4ec67abc..a69d2b037 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -366,15 +366,6 @@ dependencies = [ "syn 2.0.28", ] -[[package]] -name = "deranged" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" -dependencies = [ - "powerfmt", -] - [[package]] name = "dirs" version = "5.0.1" @@ -509,18 +500,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "filetime" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.2.16", - "windows-sys 0.48.0", -] - [[package]] name = "flate2" version = "1.0.27" @@ -601,37 +580,31 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.51.0" +version = "0.55.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ce5c049b1afcae9bb9e10c0f6dd8eb1335e8647fb7fd34732a66133ca3b9886" +checksum = "002667cd1ebb789313d0d0afe3d23b2821cf3b0e91605095f0e6d8751f0ceeea" dependencies = [ "gix-actor", - "gix-attributes", "gix-commitgraph", "gix-config", - "gix-credentials", "gix-date", "gix-diff", "gix-discover", - "gix-features 0.32.1", - "gix-filter", - "gix-fs 0.4.1", + "gix-features", + "gix-fs", "gix-glob", "gix-hash", "gix-hashtable", - "gix-ignore", - "gix-index", "gix-lock", - "gix-mailmap", - "gix-negotiate", + "gix-macros", "gix-object", "gix-odb", "gix-pack", "gix-path", - "gix-prompt", "gix-ref", "gix-refspec", "gix-revision", + "gix-revwalk", "gix-sec", "gix-tempfile", "gix-trace", @@ -639,10 +612,8 @@ dependencies = [ "gix-url", "gix-utils", "gix-validate", - "gix-worktree", - "log", "once_cell", - "signal-hook", + "parking_lot", "smallvec", "thiserror", "unicode-normalization", @@ -650,42 +621,16 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.24.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd2566c12095a584716f2c16f051850bd8987f57556f1fef4a7cce0300b83d0" +checksum = "948a5f9e43559d16faf583694f1c742eb401ce24ce8e6f2238caedea7486433c" dependencies = [ "bstr", "btoi", "gix-date", "itoa", - "nom", - "thiserror", -] - -[[package]] -name = "gix-attributes" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a134a674e39e238bd273326a9815296cc71f867ad5466518da71392cff98ce" -dependencies = [ - "bstr", - "gix-glob", - "gix-path", - "gix-quote", - "kstring", - "log", - "smallvec", - "thiserror", - "unicode-bom", -] - -[[package]] -name = "gix-bitmap" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" -dependencies = [ "thiserror", + "winnow 0.5.17", ] [[package]] @@ -697,24 +642,15 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gix-command" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c576cfbf577f72c097b5f88aedea502cd62952bdc1fb3adcab4531d5525a4c7" -dependencies = [ - "bstr", -] - [[package]] name = "gix-commitgraph" -version = "0.18.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8219fe6f39588a29dbfb8d1c244b07ee653126edc5b6f3860752c3b5454fa10b" +checksum = "7e8bc78b1a6328fa6d8b3a53b6c73997af37fd6bfc1d6c49f149e63bda5cbb36" dependencies = [ "bstr", "gix-chunk", - "gix-features 0.32.1", + "gix-features", "gix-hash", "memmap2 0.7.1", "thiserror", @@ -722,18 +658,17 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.26.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2135b921a699a4c36167148193bea23c653a16ef0686f6a280e383469709a773" +checksum = "5cae98c6b4c66c09379bc35274b172587d6b0ac369a416c39128ad8c6454f9bb" dependencies = [ "bstr", "gix-config-value", - "gix-features 0.32.1", + "gix-features", "gix-glob", "gix-path", "gix-ref", "gix-sec", - "log", "memchr", "once_cell", "smallvec", @@ -744,9 +679,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.12.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" +checksum = "ea7505b97f4d8e7933e29735a568ba2f86d8de466669d9f0e8321384f9972f47" dependencies = [ "bitflags 2.4.0", "bstr", @@ -755,27 +690,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gix-credentials" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307d91ec5f7c8e9bfaa217fe30c2e0099101cbe83dbed27a222dbb6def38725f" -dependencies = [ - "bstr", - "gix-command", - "gix-config-value", - "gix-path", - "gix-prompt", - "gix-sec", - "gix-url", - "thiserror", -] - [[package]] name = "gix-date" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a825babda995d788e30d306a49dacd1e93d5f5d33d53c7682d0347cef40333c" +checksum = "fc7df669639582dc7c02737642f76890b03b5544e141caba68a7d6b4eb551e0d" dependencies = [ "bstr", "itoa", @@ -785,21 +704,20 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.33.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49d7a9a9ed5ec3428c3061da45d0fc5f50b3c07b91ea4e7ec4959668f25f6c" +checksum = "931394f69fb8c9ed6afc0aae3487bd869e936339bcc13ed8884472af072e0554" dependencies = [ "gix-hash", "gix-object", - "imara-diff", "thiserror", ] [[package]] name = "gix-discover" -version = "0.22.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "041480eb03d8aa0894d9b73d25d182d51bc4d0ea8925a6ee0c971262bbc7715e" +checksum = "a45d5cf0321178883e38705ab2b098f625d609a7d4c391b33ac952eff2c490f2" dependencies = [ "bstr", "dunce", @@ -812,20 +730,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06142d8cff5d17509399b04052b64d2f9b3a311d5cff0b1a32b220f62cd0d595" -dependencies = [ - "gix-hash", - "gix-trace", - "libc", -] - -[[package]] -name = "gix-features" -version = "0.32.1" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882695cccf38da4c3cc7ee687bdb412cf25e37932d7f8f2c306112ea712449f1" +checksum = "51f4365ba17c4f218d7fd9ec102b8d2d3cb0ca200a835e81151ace7778aec827" dependencies = [ "crc32fast", "flate2", @@ -839,117 +746,53 @@ dependencies = [ "walkdir", ] -[[package]] -name = "gix-filter" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4d4d61f2ab07de4612f8e078d7f1a443c7ab5c40f382784c8eacdf0fd172b9" -dependencies = [ - "bstr", - "encoding_rs", - "gix-attributes", - "gix-command", - "gix-hash", - "gix-object", - "gix-packetline-blocking", - "gix-path", - "gix-quote", - "gix-trace", - "smallvec", - "thiserror", -] - -[[package]] -name = "gix-fs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb15956bc0256594c62a2399fcf6958a02a11724217eddfdc2b49b21b6292496" -dependencies = [ - "gix-features 0.31.1", -] - [[package]] name = "gix-fs" -version = "0.4.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5b6e9d34a2c61ea4a02bbca94c409ab6dbbca1348cbb67298cd7fed8758761" +checksum = "8cd171c0cae97cd0dc57e7b4601cb1ebf596450e263ef3c02be9107272c877bd" dependencies = [ - "gix-features 0.32.1", + "gix-features", ] [[package]] name = "gix-glob" -version = "0.10.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7255c717f49a556fa5029f6d9f2b3c008b4dd016c87f23c2ab8ca9636d5fade" +checksum = "8fac08925dbc14d414bd02eb45ffb4cecd912d1fce3883f867bd0103c192d3e4" dependencies = [ "bitflags 2.4.0", "bstr", - "gix-features 0.32.1", + "gix-features", "gix-path", ] [[package]] name = "gix-hash" -version = "0.11.4" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" +checksum = "1884c7b41ea0875217c1be9ce91322f90bde433e91d374d0e1276073a51ccc60" dependencies = [ - "hex", + "faster-hex", "thiserror", ] [[package]] name = "gix-hashtable" -version = "0.2.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385f4ce6ecf3692d313ca3aa9bd3b3d8490de53368d6d94bedff3af8b6d9c58d" +checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" dependencies = [ "gix-hash", "hashbrown 0.14.1", "parking_lot", ] -[[package]] -name = "gix-ignore" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88b95ceb3bc45abcab6eb55ef4e0053e58b4df0712d3f9aec7d0ca990952603" -dependencies = [ - "bstr", - "gix-glob", - "gix-path", - "unicode-bom", -] - -[[package]] -name = "gix-index" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732f61ec71576bd443a3c24f4716dc7eac180d8929e7bb8603c7310161507106" -dependencies = [ - "bitflags 2.4.0", - "bstr", - "btoi", - "filetime", - "gix-bitmap", - "gix-features 0.32.1", - "gix-fs 0.4.1", - "gix-hash", - "gix-lock", - "gix-object", - "gix-traverse", - "itoa", - "memmap2 0.7.1", - "smallvec", - "thiserror", -] - [[package]] name = "gix-lock" -version = "7.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328f50aad713ab606caeaf834459ef915ccdfbb9133ac6cd54616d601aa9249f" +checksum = "f4feb1dcd304fe384ddc22edba9dd56a42b0800032de6537728cea2f033a4f37" dependencies = [ "gix-tempfile", "gix-utils", @@ -957,62 +800,44 @@ dependencies = [ ] [[package]] -name = "gix-mailmap" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc0dbbf35d29639770af68d7ff55924d83786c8924b0e6a1766af1a98b7d58b" -dependencies = [ - "bstr", - "gix-actor", - "gix-date", - "thiserror", -] - -[[package]] -name = "gix-negotiate" -version = "0.5.1" +name = "gix-macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0061b7ae867e830c77b1ecfc5875f0d042aebb3d7e6014d04fd86ca6c71d59" +checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ - "bitflags 2.4.0", - "gix-commitgraph", - "gix-date", - "gix-hash", - "gix-object", - "gix-revwalk", - "smallvec", - "thiserror", + "proc-macro2", + "quote", + "syn 2.0.28", ] [[package]] name = "gix-object" -version = "0.33.2" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdd87520c71a19afecfa616863a4b761621074878f5a3999243b3e37e233943" +checksum = "740f2a44267f58770a1cb3a3d01d14e67b089c7136c48d4bddbb3cfd2bf86a51" dependencies = [ "bstr", "btoi", "gix-actor", "gix-date", - "gix-features 0.32.1", + "gix-features", "gix-hash", "gix-validate", - "hex", "itoa", - "nom", "smallvec", "thiserror", + "winnow 0.5.17", ] [[package]] name = "gix-odb" -version = "0.50.2" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e827dbda6d3dabadb94cd437d0e0fe8c314a60d136a3235fc6f5bf7b96b976ac" +checksum = "8630b56cb80d8fa684d383dad006a66401ee8314e12fbf0e566ddad8c115143b" dependencies = [ "arc-swap", "gix-date", - "gix-features 0.32.1", + "gix-features", "gix-hash", "gix-object", "gix-pack", @@ -1025,42 +850,29 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.40.2" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f029a4dce9ac91da35c968c3abdcae573b3e52c123be86cbab3011599de533" +checksum = "1431ba2e30deff1405920693d54ab231c88d7c240dd6ccc936ee223d8f8697c3" dependencies = [ "clru", "gix-chunk", - "gix-diff", - "gix-features 0.32.1", + "gix-features", "gix-hash", "gix-hashtable", "gix-object", "gix-path", "gix-tempfile", - "gix-traverse", "memmap2 0.7.1", "parking_lot", "smallvec", "thiserror", ] -[[package]] -name = "gix-packetline-blocking" -version = "0.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8395f7501c84d6a1fe902035fdfd8cd86d89e2dd6be0200ec1a72fd3c92d39" -dependencies = [ - "bstr", - "faster-hex", - "thiserror", -] - [[package]] name = "gix-path" -version = "0.8.4" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18609c8cbec8508ea97c64938c33cd305b75dfc04a78d0c3b78b8b3fd618a77c" +checksum = "6a1d370115171e3ae03c5c6d4f7d096f2981a40ddccb98dfd704c773530ba73b" dependencies = [ "bstr", "gix-trace", @@ -1069,19 +881,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gix-prompt" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c22decaf4a063ccae2b2108820c8630c01bd6756656df3fe464b32b8958a5ea" -dependencies = [ - "gix-command", - "gix-config-value", - "parking_lot", - "rustix", - "thiserror", -] - [[package]] name = "gix-quote" version = "0.4.7" @@ -1095,14 +894,14 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.33.3" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db11edd78bf33043d1969fff51c567a4b30edd77ab44f6f8eb460a4c14985d" +checksum = "0ec2f6d07ac88d2fb8007ee3fa3e801856fb9d82e7366ec0ca332eb2c9d74a52" dependencies = [ "gix-actor", "gix-date", - "gix-features 0.32.1", - "gix-fs 0.4.1", + "gix-features", + "gix-fs", "gix-hash", "gix-lock", "gix-object", @@ -1110,15 +909,15 @@ dependencies = [ "gix-tempfile", "gix-validate", "memmap2 0.7.1", - "nom", "thiserror", + "winnow 0.5.17", ] [[package]] name = "gix-refspec" -version = "0.14.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19a02bf740b326d6c082a7d6f754ebe56eef900986c5e91be7cf000df9ea18d" +checksum = "ccb0974cc41dbdb43a180c7f67aa481e1c1e160fcfa8f4a55291fd1126c1a6e7" dependencies = [ "bstr", "gix-hash", @@ -1130,9 +929,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.18.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38a13500890435e3b9e7746bceda248646bfc69e259210884c98e29bb7a1aa6f" +checksum = "2ca97ac73459a7f3766aa4a5638a6e37d56d4c7962bc1986fbaf4883d0772588" dependencies = [ "bstr", "gix-date", @@ -1140,14 +939,15 @@ dependencies = [ "gix-hashtable", "gix-object", "gix-revwalk", + "gix-trace", "thiserror", ] [[package]] name = "gix-revwalk" -version = "0.4.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d4cbaf3cfbfde2b81b5ee8b469aff42c34693ce0fe17fc3c244d5085307f2c" +checksum = "a16d8c892e4cd676d86f0265bf9d40cefd73d8d94f86b213b8b77d50e77efae0" dependencies = [ "gix-commitgraph", "gix-date", @@ -1160,9 +960,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.8.4" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" +checksum = "92b9542ac025a8c02ed5d17b3fc031a111a384e859d0be3532ec4d58c40a0f28" dependencies = [ "bitflags 2.4.0", "gix-path", @@ -1172,16 +972,14 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "7.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fac8310c17406ea619af72f42ee46dac795110f68f41b4f4fa231b69889c6a2" +checksum = "05cc2205cf10d99f70b96e04e16c55d4c7cf33efc151df1f793e29fd12a931f8" dependencies = [ - "gix-fs 0.3.0", + "gix-fs", "libc", "once_cell", "parking_lot", - "signal-hook", - "signal-hook-registry", "tempfile", ] @@ -1193,9 +991,9 @@ checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-traverse" -version = "0.30.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12e0fe428394226c37dd686ad64b09a04b569fe157d638b125b4a4c1e7e2df0" +checksum = "14d050ec7d4e1bb76abf0636cf4104fb915b70e54e3ced9a4427c999100ff38a" dependencies = [ "gix-commitgraph", "gix-date", @@ -1209,12 +1007,12 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.21.1" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4411bdbd1d46b35ae50e84c191660d437f89974e4236627785024be0b577170a" +checksum = "b1b9ac8ed32ad45f9fc6c5f8c0be2ed911e544a5a19afd62d95d524ebaa95671" dependencies = [ "bstr", - "gix-features 0.32.1", + "gix-features", "gix-path", "home", "thiserror", @@ -1232,33 +1030,11 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" -dependencies = [ - "bstr", - "thiserror", -] - -[[package]] -name = "gix-worktree" -version = "0.23.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f8bb6dd57dc6c9dfa03cc2cf2cc0942edae405eb6dfd1c34dbd2be00a90cab2" +checksum = "e05cab2b03a45b866156e052aa38619f4ece4adcb2f79978bfc249bc3b21b8c5" dependencies = [ "bstr", - "filetime", - "gix-attributes", - "gix-features 0.32.1", - "gix-filter", - "gix-fs 0.4.1", - "gix-glob", - "gix-hash", - "gix-ignore", - "gix-index", - "gix-object", - "gix-path", - "io-close", "thiserror", ] @@ -1547,12 +1323,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "home" version = "0.5.4" @@ -1639,16 +1409,6 @@ version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" -[[package]] -name = "io-close" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadcf447f06744f8ce713d2d6239bb5bde2c357a452397a9ed90c625da390bc" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "itoa" version = "1.0.6" @@ -1664,15 +1424,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kstring" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" -dependencies = [ - "static_assertions", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -1772,12 +1523,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1799,16 +1544,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "nucleo" version = "0.2.1" @@ -1921,12 +1656,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "proc-macro2" version = "1.0.63" @@ -1938,9 +1667,9 @@ dependencies = [ [[package]] name = "prodash" -version = "25.0.0" +version = "26.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3236ce1618b6da4c7b618e0143c4d5b5dc190f75f81c49f248221382f7e9e9ae" +checksum = "794b5bf8e2d19b53dcdcec3e4bba628e20f5b6062503ba89281fa7037dd7bbcf" [[package]] name = "pulldown-cmark" @@ -2404,15 +2133,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ - "deranged", "itoa", "libc", "num_threads", - "powerfmt", "serde", "time-core", "time-macros", @@ -2420,15 +2147,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] From 7c98b1c8293139e0ddbd8a71bdc350f5e0cef41c Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 8 Aug 2023 18:13:57 -0500 Subject: [PATCH 017/393] Fix 'Tree::lookup_entry_by_path' usage --- helix-vcs/src/git.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-vcs/src/git.rs b/helix-vcs/src/git.rs index cd28d5e48..88dba70c8 100644 --- a/helix-vcs/src/git.rs +++ b/helix-vcs/src/git.rs @@ -126,7 +126,7 @@ fn find_file_in_commit(repo: &Repository, commit: &Commit, file: &Path) -> Resul let rel_path = file.strip_prefix(repo_dir)?; let tree = commit.tree()?; let tree_entry = tree - .lookup_entry_by_path(rel_path)? + .lookup_entry_by_path(rel_path, &mut Vec::new())? .context("file is untracked")?; match tree_entry.mode() { // not a file, everything is new, do not show diff From d9d7f67898a09816f51e9a699975a97734ec114f Mon Sep 17 00:00:00 2001 From: Lorenzo Bellina <59364991+TheRealLorenz@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:42:25 +0200 Subject: [PATCH 018/393] Add support for showing all LSPs in --health (#7315) * Add support for showing all LSPs in --health * Add support for showing all LSPs in --health languages * Use available/configured in --health languages * Apply @AlexanderBrevig suggestion in --health * Update `--health ` Better output (inspired by #8156). Handle the case where no LSPs are configured. * Display all LSPs in `--health languages` instead of x/x Displays all LSPs as a list in the table generated wih `--health languages` * Make check_binary accept Optional references to str Avoids some calls to .clone() * Apply @the-mikedavis suggestions * Avoid useless collecting and cloning * Use for loop instead of .try_for_each() --- helix-term/src/health.rs | 60 +++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/helix-term/src/health.rs b/helix-term/src/health.rs index 8f9218777..dff903192 100644 --- a/helix-term/src/health.rs +++ b/helix-term/src/health.rs @@ -181,8 +181,8 @@ pub fn languages_all() -> std::io::Result<()> { .language .sort_unstable_by_key(|l| l.language_id.clone()); - let check_binary = |cmd: Option| match cmd { - Some(cmd) => match which::which(&cmd) { + let check_binary = |cmd: Option<&str>| match cmd { + Some(cmd) => match which::which(cmd) { Ok(_) => column(&format!("✓ {}", cmd), Color::Green), Err(_) => column(&format!("✘ {}", cmd), Color::Red), }, @@ -192,17 +192,15 @@ pub fn languages_all() -> std::io::Result<()> { for lang in &syn_loader_conf.language { column(&lang.language_id, Color::Reset); - // TODO multiple language servers (check binary for each supported language server, not just the first) - - let lsp = lang.language_servers.first().and_then(|ls| { + let mut cmds = lang.language_servers.iter().filter_map(|ls| { syn_loader_conf .language_server .get(&ls.name) - .map(|config| config.command.clone()) + .map(|config| config.command.as_str()) }); - check_binary(lsp); + check_binary(cmds.next()); - let dap = lang.debugger.as_ref().map(|dap| dap.command.to_string()); + let dap = lang.debugger.as_ref().map(|dap| dap.command.as_str()); check_binary(dap); for ts_feat in TsFeature::all() { @@ -213,6 +211,12 @@ pub fn languages_all() -> std::io::Result<()> { } writeln!(stdout)?; + + for cmd in cmds { + column("", Color::Reset); + check_binary(Some(cmd)); + writeln!(stdout)?; + } } Ok(()) @@ -268,15 +272,12 @@ pub fn language(lang_str: String) -> std::io::Result<()> { } }; - // TODO multiple language servers - probe_protocol( + probe_protocols( "language server", - lang.language_servers.first().and_then(|ls| { - syn_loader_conf - .language_server - .get(&ls.name) - .map(|config| config.command.clone()) - }), + lang.language_servers + .iter() + .filter_map(|ls| syn_loader_conf.language_server.get(&ls.name)) + .map(|config| config.command.as_str()), )?; probe_protocol( @@ -291,6 +292,33 @@ pub fn language(lang_str: String) -> std::io::Result<()> { Ok(()) } +/// Display diagnostics about multiple LSPs and DAPs. +fn probe_protocols<'a, I: Iterator + 'a>( + protocol_name: &str, + server_cmds: I, +) -> std::io::Result<()> { + let stdout = std::io::stdout(); + let mut stdout = stdout.lock(); + let mut server_cmds = server_cmds.peekable(); + + write!(stdout, "Configured {}s:", protocol_name)?; + if server_cmds.peek().is_none() { + writeln!(stdout, "{}", " None".yellow())?; + return Ok(()); + } + writeln!(stdout)?; + + for cmd in server_cmds { + let (path, icon) = match which::which(cmd) { + Ok(path) => (path.display().to_string().green(), "✓".green()), + Err(_) => (format!("'{}' not found in $PATH", cmd).red(), "✘".red()), + }; + writeln!(stdout, " {} {}: {}", icon, cmd, path)?; + } + + Ok(()) +} + /// Display diagnostics about LSP and DAP. fn probe_protocol(protocol_name: &str, server_cmd: Option) -> std::io::Result<()> { let stdout = std::io::stdout(); From cd591647ec93843d0f8d523253cd2ee3993f7e28 Mon Sep 17 00:00:00 2001 From: Yomain <40139584+yo-main@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:07:00 +0200 Subject: [PATCH 019/393] fix(lsp): ensure we only highlight diagnostics for lsp with the feature enabled (#8551) --- helix-term/src/ui/editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index dd6fff087..31195a4e5 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -365,7 +365,7 @@ impl EditorView { let mut warning_vec = Vec::new(); let mut error_vec = Vec::new(); - for diagnostic in doc.diagnostics() { + for diagnostic in doc.shown_diagnostics() { // Separate diagnostics into different Vecs by severity. let (vec, scope) = match diagnostic.severity { Some(Severity::Info) => (&mut info_vec, info), From 814cf177d470e9890e5d62ecf46ff2f9cf3ed75a Mon Sep 17 00:00:00 2001 From: Ryan Mehri <52933714+rmehri01@users.noreply.github.com> Date: Tue, 17 Oct 2023 03:19:57 -0700 Subject: [PATCH 020/393] bump tree-sitter-haskell and update queries (#8558) --- languages.toml | 2 +- runtime/queries/haskell/highlights.scm | 35 ++++++++++++++++++-------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/languages.toml b/languages.toml index 048c76bb4..cf2783de9 100644 --- a/languages.toml +++ b/languages.toml @@ -1094,7 +1094,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "haskell" -source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "98fc7f59049aeb713ab9b72a8ff25dcaaef81087" } +source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "d7ac98f49e3ed7e17541256fe3881a967d7ffdd3" } [[language]] name = "haskell-persistent" diff --git a/runtime/queries/haskell/highlights.scm b/runtime/queries/haskell/highlights.scm index 5009f3b51..18c57c930 100644 --- a/runtime/queries/haskell/highlights.scm +++ b/runtime/queries/haskell/highlights.scm @@ -33,6 +33,11 @@ ;; ---------------------------------------------------------------------------- ;; Keywords, operators, includes +[ + "forall" + "∀" +] @keyword.control.repeat + (pragma) @constant.macro [ @@ -68,10 +73,7 @@ "@" ] @operator -(qualified_module (module) @constructor) -(qualified_type (module) @namespace) -(qualified_variable (module) @namespace) -(import (module) @namespace) +(module) @namespace [ (where) @@ -92,8 +94,6 @@ "do" "mdo" "rec" - "forall" - "∀" "infix" "infixl" "infixr" @@ -104,22 +104,35 @@ ;; Functions and variables (signature name: (variable) @type) -(function name: (variable) @function) - -(variable) @variable -"_" @variable.builtin +(function + name: (variable) @function + patterns: (patterns)) +((signature (fun)) . (function (variable) @function)) +((signature (context (fun))) . (function (variable) @function)) +((signature (forall (context (fun)))) . (function (variable) @function)) (exp_infix (variable) @operator) ; consider infix functions as operators -("@" @namespace) ; "as" pattern operator, e.g. x@Constructor +(exp_infix (exp_name) @function) +(exp_apply . (exp_name (variable) @function)) +(exp_apply . (exp_name (qualified_variable (variable) @function))) +(variable) @variable +(pat_wildcard) @variable ;; ---------------------------------------------------------------------------- ;; Types (type) @type +(type_variable) @type (constructor) @constructor ; True or False ((constructor) @_bool (#match? @_bool "(True|False)")) @constant.builtin.boolean + +;; ---------------------------------------------------------------------------- +;; Quasi-quotes + +(quoter) @function +; Highlighting of quasiquote_body is handled by injections.scm From 83ce8d0c5d6cccf4d9c43075377ed9b91a5aa606 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:20:20 +0200 Subject: [PATCH 021/393] build(deps): bump regex from 1.9.6 to 1.10.2 (#8557) Bumps [regex](https://github.com/rust-lang/regex) from 1.9.6 to 1.10.2. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.9.6...1.10.2) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a69d2b037..589a1caf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -120,7 +120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "regex-automata", + "regex-automata 0.3.9", "serde", ] @@ -1771,14 +1771,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.6" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick 1.0.2", "memchr", - "regex-automata", - "regex-syntax 0.7.5", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -1786,10 +1786,16 @@ name = "regex-automata" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick 1.0.2", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -1800,9 +1806,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ropey" From fc16449efe58a49c15e19c9fde6584d8625493fd Mon Sep 17 00:00:00 2001 From: Joe-Zer0 <70542456+Joe-Zer0@users.noreply.github.com> Date: Tue, 17 Oct 2023 05:46:28 -0500 Subject: [PATCH 022/393] Add nord night theme (#8549) --- runtime/themes/nord-night.toml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 runtime/themes/nord-night.toml diff --git a/runtime/themes/nord-night.toml b/runtime/themes/nord-night.toml new file mode 100644 index 000000000..b759738bd --- /dev/null +++ b/runtime/themes/nord-night.toml @@ -0,0 +1,23 @@ +# Nord Night +# +# Based on the Nord theme, with minor modifications. +# The Background and the Primary Text color have been slightly darkened. +# The Aurora color palette has been used more generously. + +inherits = 'nord' + +'constant' = 'nord13' +'constant.builtin.boolean' = 'nord13' +'constant.numeric' = 'nord13' + +'keyword.control' = 'nord11' +'keyword.control.conditional' = 'nord11' +'keyword.control.exception' = 'nord11' +'keyword.control.repeat' = 'nord11' +'keyword.control.return' = 'nord11' + +'variable.parameter' = 'nord15' + +[palette] +nord0 = '#252933' +nord4 = '#C0C5CF' From e6d2835b0907102831a8979688a8464c064ff842 Mon Sep 17 00:00:00 2001 From: Bjorn Ove Hay Andersen Date: Wed, 18 Oct 2023 10:45:05 +0200 Subject: [PATCH 023/393] Fixed issue when the first file specified as an argument was a relative directory (#8520) --- helix-term/src/application.rs | 3 +-- helix-term/src/args.rs | 1 + helix-term/src/main.rs | 10 +++++++--- helix-term/tests/test/helpers.rs | 8 ++++++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index fabd0fa4d..43e1cdfc9 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -162,8 +162,7 @@ impl Application { // Unset path to prevent accidentally saving to the original tutor file. doc_mut!(editor).set_path(None); } else if !args.files.is_empty() { - let first = &args.files[0].0; // we know it's not empty - if first.is_dir() { + if args.open_cwd { // NOTE: The working directory is already set to args.files[0] in main() editor.new_file(Action::VerticalSplit); let picker = ui::file_picker(".".into(), &config.load().editor); diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index 6a49889b6..99ce39926 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -17,6 +17,7 @@ pub struct Args { pub log_file: Option, pub config_file: Option, pub files: Vec<(PathBuf, Position)>, + pub open_cwd: bool, pub working_directory: Option, } diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index 8db5f3100..6411a7c5f 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -76,7 +76,7 @@ FLAGS: helix_loader::default_log_file().display(), ); - let args = Args::parse_args().context("could not parse arguments")?; + let mut args = Args::parse_args().context("could not parse arguments")?; helix_loader::initialize_config_file(args.config_file.clone()); helix_loader::initialize_log_file(args.log_file.clone()); @@ -118,10 +118,14 @@ FLAGS: // NOTE: Set the working directory early so the correct configuration is loaded. Be aware that // Application::new() depends on this logic so it must be updated if this changes. - if let Some((path, true)) = args.files.first().map(|(path, _)| (path, path.is_dir())) { + if let Some(path) = &args.working_directory { helix_loader::set_current_working_dir(path)?; - } else if let Some(path) = &args.working_directory { + } + + // If the first file is a directory, it will be the working directory and a file picker will be opened + if let Some((path, _)) = args.files.first().filter(|p| p.0.is_dir()) { helix_loader::set_current_working_dir(path)?; + args.open_cwd = true; // Signal Application that we want to open the picker on "." } let config = match Config::load_default() { diff --git a/helix-term/tests/test/helpers.rs b/helix-term/tests/test/helpers.rs index e6762baf9..112b5e358 100644 --- a/helix-term/tests/test/helpers.rs +++ b/helix-term/tests/test/helpers.rs @@ -320,6 +320,14 @@ impl AppBuilder { } pub fn build(self) -> anyhow::Result { + if let Some(path) = &self.args.working_directory { + bail!("Changing the working directory to {path:?} is not yet supported for integration tests"); + } + + if let Some((path, _)) = self.args.files.first().filter(|p| p.0.is_dir()) { + bail!("Having the directory {path:?} in args.files[0] is not yet supported for integration tests"); + } + let mut app = Application::new(self.args, self.config, self.syn_conf)?; if let Some((text, selection)) = self.input { From 7d5bc9b87860b7fbbee0fa4e54e14a22d3ef51b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 22:55:42 +0900 Subject: [PATCH 024/393] build(deps): bump serde from 1.0.188 to 1.0.189 (#8554) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.188 to 1.0.189. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.188...v1.0.189) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 589a1caf8..806ade651 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1868,18 +1868,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", From ac8759c0c92c4ae257d9e687cb3f748ac773df28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 22:56:07 +0900 Subject: [PATCH 025/393] build(deps): bump bitflags from 2.4.0 to 2.4.1 (#8555) Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/bitflags/bitflags/releases) - [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md) - [Commits](https://github.com/bitflags/bitflags/compare/2.4.0...2.4.1) --- updated-dependencies: - dependency-name: bitflags dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 806ade651..8d2de2762 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,9 +109,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bstr" @@ -301,7 +301,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "crossterm_winapi", "filedescriptor", "futures-core", @@ -683,7 +683,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea7505b97f4d8e7933e29735a568ba2f86d8de466669d9f0e8321384f9972f47" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "gix-path", "libc", @@ -761,7 +761,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fac08925dbc14d414bd02eb45ffb4cecd912d1fce3883f867bd0103c192d3e4" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "gix-features", "gix-path", @@ -964,7 +964,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92b9542ac025a8c02ed5d17b3fc031a111a384e859d0be3532ec4d58c40a0f28" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "gix-path", "libc", "windows", @@ -1112,7 +1112,7 @@ version = "0.6.0" dependencies = [ "ahash", "arc-swap", - "bitflags 2.4.0", + "bitflags 2.4.1", "chrono", "dunce", "encoding_rs", @@ -1253,7 +1253,7 @@ dependencies = [ name = "helix-tui" version = "0.6.0" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "cassowary", "crossterm", "helix-core", @@ -1287,7 +1287,7 @@ version = "0.6.0" dependencies = [ "anyhow", "arc-swap", - "bitflags 2.4.0", + "bitflags 2.4.1", "chardetng", "clipboard-win", "crossterm", @@ -1832,7 +1832,7 @@ version = "0.38.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", From 6d598d32398943718b4943a452ae6dd8490fa439 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 22:56:28 +0900 Subject: [PATCH 026/393] build(deps): bump rustix from 0.38.18 to 0.38.19 (#8556) Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.18 to 0.38.19. - [Release notes](https://github.com/bytecodealliance/rustix/releases) - [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.18...v0.38.19) --- updated-dependencies: - dependency-name: rustix dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d2de2762..ab6f40347 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1828,9 +1828,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.18" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ "bitflags 2.4.1", "errno", From 8d44459c6ab1e1c7f26c8da4e6afafdb439c8450 Mon Sep 17 00:00:00 2001 From: Paul Olteanu Date: Sat, 21 Oct 2023 05:20:29 -0400 Subject: [PATCH 027/393] Add helix-specific ignore files (#8099) --- helix-term/src/commands.rs | 137 +++++++++++++++++++------------------ helix-term/src/ui/mod.rs | 3 + 2 files changed, 75 insertions(+), 65 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 0fd011cc9..75df430a3 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2184,7 +2184,10 @@ fn global_search(cx: &mut Context) { let searcher = SearcherBuilder::new() .binary_detection(BinaryDetection::quit(b'\x00')) .build(); - WalkBuilder::new(search_root) + + let mut walk_builder = WalkBuilder::new(search_root); + + walk_builder .hidden(file_picker_config.hidden) .parents(file_picker_config.parents) .ignore(file_picker_config.ignore) @@ -2195,73 +2198,77 @@ fn global_search(cx: &mut Context) { .max_depth(file_picker_config.max_depth) .filter_entry(move |entry| { filter_picker_entry(entry, &absolute_root, dedup_symlinks) - }) - .build_parallel() - .run(|| { - let mut searcher = searcher.clone(); - let matcher = matcher.clone(); - let injector = injector_.clone(); - let documents = &documents; - Box::new(move |entry: Result| -> WalkState { - let entry = match entry { - Ok(entry) => entry, - Err(_) => return WalkState::Continue, - }; - - match entry.file_type() { - Some(entry) if entry.is_file() => {} - // skip everything else - _ => return WalkState::Continue, - }; - - let mut stop = false; - let sink = sinks::UTF8(|line_num, _| { - stop = injector - .push(FileResult::new(entry.path(), line_num as usize - 1)) - .is_err(); - - Ok(!stop) - }); - let doc = documents.iter().find(|&(doc_path, _)| { - doc_path - .as_ref() - .map_or(false, |doc_path| doc_path == entry.path()) - }); - - let result = if let Some((_, doc)) = doc { - // there is already a buffer for this file - // search the buffer instead of the file because it's faster - // and captures new edits without requiring a save - if searcher.multi_line_with_matcher(&matcher) { - // in this case a continous buffer is required - // convert the rope to a string - let text = doc.to_string(); - searcher.search_slice(&matcher, text.as_bytes(), sink) - } else { - searcher.search_reader( - &matcher, - RopeReader::new(doc.slice(..)), - sink, - ) - } - } else { - searcher.search_path(&matcher, entry.path(), sink) - }; + }); - if let Err(err) = result { - log::error!( - "Global search error: {}, {}", - entry.path().display(), - err - ); - } - if stop { - WalkState::Quit + walk_builder + .add_custom_ignore_filename(helix_loader::config_dir().join("ignore")); + walk_builder.add_custom_ignore_filename(".helix/ignore"); + + walk_builder.build_parallel().run(|| { + let mut searcher = searcher.clone(); + let matcher = matcher.clone(); + let injector = injector_.clone(); + let documents = &documents; + Box::new(move |entry: Result| -> WalkState { + let entry = match entry { + Ok(entry) => entry, + Err(_) => return WalkState::Continue, + }; + + match entry.file_type() { + Some(entry) if entry.is_file() => {} + // skip everything else + _ => return WalkState::Continue, + }; + + let mut stop = false; + let sink = sinks::UTF8(|line_num, _| { + stop = injector + .push(FileResult::new(entry.path(), line_num as usize - 1)) + .is_err(); + + Ok(!stop) + }); + let doc = documents.iter().find(|&(doc_path, _)| { + doc_path + .as_ref() + .map_or(false, |doc_path| doc_path == entry.path()) + }); + + let result = if let Some((_, doc)) = doc { + // there is already a buffer for this file + // search the buffer instead of the file because it's faster + // and captures new edits without requiring a save + if searcher.multi_line_with_matcher(&matcher) { + // in this case a continous buffer is required + // convert the rope to a string + let text = doc.to_string(); + searcher.search_slice(&matcher, text.as_bytes(), sink) } else { - WalkState::Continue + searcher.search_reader( + &matcher, + RopeReader::new(doc.slice(..)), + sink, + ) } - }) - }); + } else { + searcher.search_path(&matcher, entry.path(), sink) + }; + + if let Err(err) = result { + log::error!( + "Global search error: {}, {}", + entry.path().display(), + err + ); + } + if stop { + WalkState::Quit + } else { + WalkState::Continue + } + }) + }); }); cx.jobs.callback(async move { diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 12ac1783c..660bbfea3 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -177,6 +177,9 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> Picker .max_depth(config.file_picker.max_depth) .filter_entry(move |entry| filter_picker_entry(entry, &absolute_root, dedup_symlinks)); + walk_builder.add_custom_ignore_filename(helix_loader::config_dir().join("ignore")); + walk_builder.add_custom_ignore_filename(".helix/ignore"); + // We want to exclude files that the editor can't handle yet let mut type_builder = TypesBuilder::new(); type_builder From 764715a6c069754b852ed9e8d98aaf7efd88abe6 Mon Sep 17 00:00:00 2001 From: rsteube Date: Sat, 21 Oct 2023 14:15:18 +0200 Subject: [PATCH 028/393] languages: add templ (#8540) --- book/src/generated/lang-support.md | 1 + languages.toml | 14 ++++ runtime/queries/templ/highlights.scm | 99 ++++++++++++++++++++++++++++ runtime/queries/templ/injections.scm | 4 ++ 4 files changed, 118 insertions(+) create mode 100644 runtime/queries/templ/highlights.scm create mode 100644 runtime/queries/templ/injections.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 429f54f55..6fdc6f115 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -155,6 +155,7 @@ | t32 | ✓ | | | | | tablegen | ✓ | ✓ | ✓ | | | task | ✓ | | | | +| templ | ✓ | | | `templ` | | tfvars | ✓ | | ✓ | `terraform-ls` | | todotxt | ✓ | | | | | toml | ✓ | | | `taplo` | diff --git a/languages.toml b/languages.toml index cf2783de9..77c629e49 100644 --- a/languages.toml +++ b/languages.toml @@ -74,6 +74,7 @@ svlangserver = { command = "svlangserver", args = [] } swipl = { command = "swipl", args = [ "-g", "use_module(library(lsp_server))", "-g", "lsp_server:main", "-t", "halt", "--", "stdio" ] } tailwindcss-ls = { command = "tailwindcss-language-server", args = ["--stdio"] } taplo = { command = "taplo", args = ["lsp", "stdio"] } +templ = { command = "templ", args = ["lsp"] } terraform-ls = { command = "terraform-ls", args = ["serve"] } texlab = { command = "texlab" } vala-language-server = { command = "vala-language-server" } @@ -2998,3 +2999,16 @@ roots = [] [[grammar]] name = "gemini" source = { git = "https://git.sr.ht/~sfr/tree-sitter-gemini", rev = "3cc5e4bdf572d5df4277fc2e54d6299bd59a54b3" } + +[[language]] +name = "templ" +scope = "source.templ" +file-types = ["templ"] +roots = ["go.work", "go.mod"] +comment-token = "//" +indent = { tab-width = 2, unit = " " } +language-servers = [ "templ" ] + +[[grammar]] +name = "templ" +source = { git = "https://github.com/vrischmann/tree-sitter-templ", rev = "ea56ac0655243490a4929a988f4eaa91dfccc995" } diff --git a/runtime/queries/templ/highlights.scm b/runtime/queries/templ/highlights.scm new file mode 100644 index 000000000..e5b2ede01 --- /dev/null +++ b/runtime/queries/templ/highlights.scm @@ -0,0 +1,99 @@ +(package_identifier) @namespace + +(parameter_declaration (identifier) @variable.parameter) +(variadic_parameter_declaration (identifier) @variable.parameter) + +(function_declaration + name: (identifier) @function) + +(type_spec name: (type_identifier) @type) +(type_identifier) @type +(field_identifier) @variable.other.member +(identifier) @variable + +; Function calls + +(call_expression + function: (identifier) @function) + +(call_expression + function: (selector_expression + field: (field_identifier) @function)) + +; +; These are Templ specific +; + +(component_declaration + name: (component_identifier) @function) + +(tag_start) @tag +(tag_end) @tag +(self_closing_tag) @tag +(style_element) @tag + +(attribute + name: (attribute_name) @attribute) +(attribute + value: (quoted_attribute_value) @string) + +(element_text) @string.special +(style_element_text) @string.special + +(css_property + name: (css_property_name) @attribute) + +(expression) @function.method +(dynamic_class_attribute_value) @function.method + +(component_import + name: (component_identifier) @function) + +(component_render) @function + +[ + "@" +] @operator + +[ + "func" + "var" + "const" + "templ" + "css" + "type" + "struct" + "range" + "script" +] @keyword.storage.type + +[ + "return" +] @keyword.control.return + +[ + "import" + "package" +] @keyword.control.import + +[ + "else" + "case" + "switch" + "if" + "default" +] @keyword.control.conditional + +"for" @keyword.control.repeat + +[ + (interpreted_string_literal) + (raw_string_literal) + (rune_literal) +] @string + +; Comments + +(comment) @comment + +(element_comment) @comment diff --git a/runtime/queries/templ/injections.scm b/runtime/queries/templ/injections.scm new file mode 100644 index 000000000..4dd5a6305 --- /dev/null +++ b/runtime/queries/templ/injections.scm @@ -0,0 +1,4 @@ +((script_block_text) @injection.content (#set! injection.language "javascript")) +((script_element_text) @injection.content (#set! injection.language "javascript")) + +((style_element_text) @injection.content (#set! injection.language "css")) From 31f50bf5bf0d49af7359533e0865e878184c5225 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sat, 21 Oct 2023 21:58:36 +0900 Subject: [PATCH 029/393] don't break on hyphen with :reflow (#8569) --- helix-core/src/wrap.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helix-core/src/wrap.rs b/helix-core/src/wrap.rs index 2ba8d173e..f32d6f4bc 100644 --- a/helix-core/src/wrap.rs +++ b/helix-core/src/wrap.rs @@ -1,7 +1,9 @@ use smartstring::{LazyCompact, SmartString}; +use textwrap::{Options, WordSplitter::NoHyphenation}; /// Given a slice of text, return the text re-wrapped to fit it /// within the given width. pub fn reflow_hard_wrap(text: &str, text_width: usize) -> SmartString { - textwrap::refill(text, text_width).into() + let options = Options::new(text_width).word_splitter(NoHyphenation); + textwrap::refill(text, options).into() } From 88bc52a57058941e8f56b298b179426023184ac3 Mon Sep 17 00:00:00 2001 From: Abderrahmane TAHRI JOUTI <302837+atahrijouti@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:10:42 +0200 Subject: [PATCH 030/393] Theme cyan light diff colors (#8587) --- runtime/themes/cyan_light.toml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/runtime/themes/cyan_light.toml b/runtime/themes/cyan_light.toml index 2114054d0..e18c46a9f 100644 --- a/runtime/themes/cyan_light.toml +++ b/runtime/themes/cyan_light.toml @@ -57,9 +57,12 @@ "markup.raw.inline" = "green" "markup.raw.block" = "green" -"diff.plus" = "diff_green" -"diff.minus" = "diff_red" -"diff.delta" = "diff_blue" +"diff.plus" = "green" +"diff.plus.gutter" = "gutter_green" +"diff.minus" = "red" +"diff.minus.gutter" = "gutter_red" +"diff.delta" = "blue" +"diff.delta.gutter" = "gutter_blue" # ui specific "ui.background" = { bg = "shade00" } @@ -121,7 +124,7 @@ foreground = "#25293c" comment_gray = "#808080" -diff_blue = "#C3D6E8" +gutter_blue = "#C3D6E8" faint_blue = "#E8Eef1" lighter_blue = "#d0eaff" light_blue = "#99ccff" @@ -134,7 +137,7 @@ darker_blue = "#000080" purple = "#660E7A" light_purple = "#ED9CFF" -diff_green = "#C9DEC1" +gutter_green = "#C9DEC1" green = "#00733B" light_green = "#5DCE87" green_blue = "#458383" @@ -146,6 +149,6 @@ dark_yellow = "#7A7A43" light_orange = "#f9c881" orange = "#F49810" -diff_red = "#EBBCBC" +gutter_red = "#EBBCBC" red = "#d90016" dark_red = "#7F0000" From fef4d5321b5eb1b13ba996243c88eade98e951f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 14:13:46 +0900 Subject: [PATCH 031/393] build(deps): bump ropey from 1.6.0 to 1.6.1 (#8593) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- helix-core/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab6f40347..189729f35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1812,9 +1812,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ropey" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53ce7a2c43a32e50d666e33c5a80251b31147bb4b49024bcab11fb6f20c671ed" +checksum = "93411e420bcd1a75ddd1dc3caf18c23155eda2c090631a85af21ba19e97093b5" dependencies = [ "smallvec", "str_indices", diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index fb4894137..891850128 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -17,7 +17,7 @@ integration = [] [dependencies] helix-loader = { version = "0.6", path = "../helix-loader" } -ropey = { version = "1.6.0", default-features = false, features = ["simd"] } +ropey = { version = "1.6.1", default-features = false, features = ["simd"] } smallvec = "1.11" smartstring = "1.0.1" unicode-segmentation = "1.10" From 6acbb07ca9bb0fd69e5bb1946aa2779d140128fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 14:14:00 +0900 Subject: [PATCH 032/393] build(deps): bump hashbrown from 0.14.1 to 0.14.2 (#8594) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- helix-core/Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 189729f35..def24e43e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -784,7 +784,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" dependencies = [ "gix-hash", - "hashbrown 0.14.1", + "hashbrown 0.14.2", "parking_lot", ] @@ -1098,9 +1098,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" dependencies = [ "ahash", "allocator-api2", @@ -1117,7 +1117,7 @@ dependencies = [ "dunce", "encoding_rs", "etcetera", - "hashbrown 0.14.1", + "hashbrown 0.14.2", "helix-loader", "imara-diff", "indoc", @@ -1400,7 +1400,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.2", ] [[package]] diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 891850128..29e6653aa 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -31,7 +31,7 @@ arc-swap = "1" regex = "1" bitflags = "2.4" ahash = "0.8.3" -hashbrown = { version = "0.14.1", features = ["raw"] } +hashbrown = { version = "0.14.2", features = ["raw"] } dunce = "1.0" log = "0.4" From 25ea6b81523bb2d6762b02fba467bd03240f4233 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 14:14:09 +0900 Subject: [PATCH 033/393] build(deps): bump rustix from 0.38.19 to 0.38.20 (#8595) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index def24e43e..931cdde29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1828,9 +1828,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.19" +version = "0.38.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" dependencies = [ "bitflags 2.4.1", "errno", From 9dbf882808681f495725a716b734b725baa2eb90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 14:14:18 +0900 Subject: [PATCH 034/393] build(deps): bump thiserror from 1.0.49 to 1.0.50 (#8596) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 931cdde29..ca3cb9e86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2100,18 +2100,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", From 68c7537de522cf6b38705a7af51eeaac260fdc98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:59:38 +0900 Subject: [PATCH 035/393] build(deps): bump ahash from 0.8.3 to 0.8.5 (#8597) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 47 +++++++++++++++++++++++++++++++------------ helix-core/Cargo.toml | 2 +- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca3cb9e86..3a88401ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,14 +19,15 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" dependencies = [ "cfg-if", "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -346,7 +347,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -363,7 +364,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -807,7 +808,7 @@ checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -1658,9 +1659,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -1883,7 +1884,7 @@ checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -1905,7 +1906,7 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -2047,9 +2048,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -2115,7 +2116,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -2208,7 +2209,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -2625,3 +2626,23 @@ dependencies = [ "helix-view", "toml", ] + +[[package]] +name = "zerocopy" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c19fae0c8a9efc6a8281f2e623db8af1db9e57852e04cde3e754dd2dc29340f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc56589e9ddd1f1c28d4b4b5c773ce232910a6bb67a70133d61c9e347585efe9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 29e6653aa..f0903f42b 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -30,7 +30,7 @@ once_cell = "1.18" arc-swap = "1" regex = "1" bitflags = "2.4" -ahash = "0.8.3" +ahash = "0.8.5" hashbrown = { version = "0.14.2", features = ["raw"] } dunce = "1.0" From b5d691a5d7e791f9b9581d96217f80ea10a6f2ca Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Wed, 25 Oct 2023 12:08:01 -0400 Subject: [PATCH 036/393] Add optional runtime fallback directory (#8610) --- book/src/install.md | 26 +++++++++++++++++++++++--- helix-loader/src/lib.rs | 11 ++++++++++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/book/src/install.md b/book/src/install.md index 9c052917c..01858034f 100644 --- a/book/src/install.md +++ b/book/src/install.md @@ -224,7 +224,7 @@ Or, create a symbolic link: ln -Ts $PWD/runtime ~/.config/helix/runtime ``` -If the above command fails to create a symbolic link because the file exists either move `~/.config/helix/runtime` to a new location or delete it, then run the symlink command above again. +If the above command fails to create a symbolic link because the file exists either move `~/.config/helix/runtime` to a new location or delete it, then run the symlink command above again. #### Windows @@ -257,12 +257,32 @@ following order: 1. `runtime/` sibling directory to `$CARGO_MANIFEST_DIR` directory (this is intended for developing and testing helix only). 2. `runtime/` subdirectory of OS-dependent helix user config directory. -3. `$HELIX_RUNTIME`. -4. `runtime/` subdirectory of path to Helix executable. +3. `$HELIX_RUNTIME` +4. Distribution-specific fallback directory (set at compile time—not run time— + with the `HELIX_DEFAULT_RUNTIME` environment variable) +5. `runtime/` subdirectory of path to Helix executable. This order also sets the priority for selecting which file will be used if multiple runtime directories have files with the same name. +#### Note to packagers + +If you are making a package of Helix for end users, to provide a good out of +the box experience, you should set the `HELIX_DEFAULT_RUNTIME` environment +variable at build time (before invoking `cargo build`) to a directory which +will store the final runtime files after installation. For example, say you want +to package the runtime into `/usr/lib/helix/runtime`. The rough steps a build +script could follow are: + +1. `export HELIX_DEFAULT_RUNTIME=/usr/lib/helix/runtime` +1. `cargo build --profile opt --locked --path helix-term` +1. `cp -r runtime $BUILD_DIR/usr/lib/helix/` +1. `cp target/opt/hx $BUILD_DIR/usr/bin/hx` + +This way the resulting `hx` binary will always look for its runtime directory in +`/usr/lib/helix/runtime` if the user has no custom runtime in `~/.config/helix` +or `HELIX_RUNTIME`. + ### Validating the installation To make sure everything is set up as expected you should run the Helix health diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index 82ed2edea..5337d6027 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -60,7 +60,8 @@ pub fn initialize_log_file(specified_file: Option) { /// 1. sibling directory to `CARGO_MANIFEST_DIR` (if environment variable is set) /// 2. subdirectory of user config directory (always included) /// 3. `HELIX_RUNTIME` (if environment variable is set) -/// 4. subdirectory of path to helix executable (always included) +/// 4. `HELIX_DEFAULT_RUNTIME` (if environment variable is set *at build time*) +/// 5. subdirectory of path to helix executable (always included) /// /// Postcondition: returns at least two paths (they might not exist). fn prioritize_runtime_dirs() -> Vec { @@ -81,6 +82,14 @@ fn prioritize_runtime_dirs() -> Vec { rt_dirs.push(dir.into()); } + // If this variable is set during build time, it will always be included + // in the lookup list. This allows downstream packagers to set a fallback + // directory to a location that is conventional on their distro so that they + // need not resort to a wrapper script or a global environment variable. + if let Some(dir) = std::option_env!("HELIX_DEFAULT_RUNTIME") { + rt_dirs.push(dir.into()); + } + // fallback to location of the executable being run // canonicalize the path in case the executable is symlinked let exe_rt_dir = std::env::current_exe() From 2ebcc4dbeb306cc285d47bd1d21d72c7e57ecb72 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 25 Oct 2023 11:08:46 -0500 Subject: [PATCH 037/393] Pin tree-sitter to the 0.20.10 release (#8396) --- Cargo.lock | 3 ++- Cargo.toml | 2 +- helix-core/src/syntax.rs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a88401ed..d10cd16f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2260,7 +2260,8 @@ dependencies = [ [[package]] name = "tree-sitter" version = "0.20.10" -source = "git+https://github.com/tree-sitter/tree-sitter?rev=ab09ae20d640711174b8da8a654f6b3dec93da1a#ab09ae20d640711174b8da8a654f6b3dec93da1a" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" dependencies = [ "cc", "regex", diff --git a/Cargo.toml b/Cargo.toml index 8ffe0fa7a..7217cd3de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,5 +35,5 @@ package.helix-tui.opt-level = 2 package.helix-term.opt-level = 2 [workspace.dependencies] -tree-sitter = { version = "0.20", git = "https://github.com/tree-sitter/tree-sitter", rev = "ab09ae20d640711174b8da8a654f6b3dec93da1a" } +tree-sitter = { version = "0.20" } nucleo = "0.2.0" diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 881b45098..97a882249 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1614,7 +1614,7 @@ impl<'a> Iterator for ChunksBytes<'a> { } pub struct RopeProvider<'a>(pub RopeSlice<'a>); -impl<'a> TextProvider<&'a [u8]> for RopeProvider<'a> { +impl<'a> TextProvider<'a> for RopeProvider<'a> { type I = ChunksBytes<'a>; fn text(&mut self, node: Node) -> Self::I { @@ -1628,7 +1628,7 @@ impl<'a> TextProvider<&'a [u8]> for RopeProvider<'a> { struct HighlightIterLayer<'a> { _tree: Option, cursor: QueryCursor, - captures: RefCell, &'a [u8]>>>, + captures: RefCell>>>, config: &'a HighlightConfiguration, highlight_end_stack: Vec, scope_stack: Vec>, From c7e15dd87e932934f5807065bdf2de2c382a6b09 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 25 Oct 2023 11:10:45 -0500 Subject: [PATCH 038/393] Add changelog notes for 23.10 (#8086) Co-authored-by: Pascal Kuthe --- CHANGELOG.md | 260 ++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- contrib/Helix.appdata.xml | 3 + 3 files changed, 264 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f7509b0b..b5edbf72b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,263 @@ +# 23.10 (2023-10-24) + +A big shout out to all the contributors! We had 118 contributors in this release. + +Breaking changes: + +- Support multiple language servers per language ([#2507](https://github.com/helix-editor/helix/pull/2507)) + - This is a breaking change to language configuration + +Features: + +- Support multiple language servers per language ([#2507](https://github.com/helix-editor/helix/pull/2507), [#7082](https://github.com/helix-editor/helix/pull/7082), [#7286](https://github.com/helix-editor/helix/pull/7286), [#8374](https://github.com/helix-editor/helix/pull/8374)) +- Add a statusline element for the selected register ([#7222](https://github.com/helix-editor/helix/pull/7222)) +- Add `%`, `#`, `.`, `*` and `+` special registers ([#6985](https://github.com/helix-editor/helix/pull/6985)) +- Add initial support for LSP DidChangeWatchedFiles notifications ([#7665](https://github.com/helix-editor/helix/pull/7665)) +- Search buffer contents in `global_search` ([#5652](https://github.com/helix-editor/helix/pull/5652)) +- Add a "smart tab" command that intelligently jumps the cursor on tab ([#4443](https://github.com/helix-editor/helix/pull/4443)) +- Add a statusline element for whether a file is read-only ([#7222](https://github.com/helix-editor/helix/pull/7222), [#7875](https://github.com/helix-editor/helix/pull/7875)) +- Syntax highlight regex prompts ([#7738](https://github.com/helix-editor/helix/pull/7738)) +- Allow defining alignment in indent queries ([#5355](https://github.com/helix-editor/helix/pull/5355)) +- Show visual feedback in `surround_replace` ([#7588](https://github.com/helix-editor/helix/pull/7588)) +- Switch to Nucleo for fuzzy matching ([#7814](https://github.com/helix-editor/helix/pull/7814), [#8148](https://github.com/helix-editor/helix/pull/8148), [#8192](https://github.com/helix-editor/helix/pull/8192), [#8194](https://github.com/helix-editor/helix/pull/8194)) +- Insert a trailing newline on write ([#8157](https://github.com/helix-editor/helix/pull/8157)) +- Add a `-w`/`--working-dir` CLI flag for specifying a working directory on startup ([#8223](https://github.com/helix-editor/helix/pull/8223), [#8498](https://github.com/helix-editor/helix/pull/8498), [#8520](https://github.com/helix-editor/helix/pull/8520)) +- Accept a `+N` CLI argument to set the first file's line number ([#8521](https://github.com/helix-editor/helix/pull/8521)) +- Accept Helix-specific ignore files in `.helix/ignore` and `~/.config/helix/ignore` ([#8099](https://github.com/helix-editor/helix/pull/8099)) + +Commands: + +- `merge_selections` (`A-minus`) - merge all selections into one selection that covers all ranges ([#7053](https://github.com/helix-editor/helix/pull/7053)) +- `move_prev_long_word_end` and `extend_prev_long_word_end` - move/extend to the end of the previous WORD ([#6905](https://github.com/helix-editor/helix/pull/6905)) +- `reverse_selection_contents` - swaps the values of each selection so they are reversed ([#7329](https://github.com/helix-editor/helix/pull/7329)) +- Add `:rl` and `:rla` aliases for `:reload` and `:reload-all` ([#7158](https://github.com/helix-editor/helix/pull/7158)) +- `yank_joined` - join the selections and yank to the selected register ([#7195](https://github.com/helix-editor/helix/pull/7195)) +- `:write-all!` (`:wa!`) - forcibly write all buffers to disk and create any necessary subdirectories ([#7577](https://github.com/helix-editor/helix/pull/7577)) +- `:redraw` - clear re-render the UI ([#6949](https://github.com/helix-editor/helix/pull/6949)) +- `:tree-sitter-highlight-name` - show the theme scope name of the highlight under the cursor ([#8170](https://github.com/helix-editor/helix/pull/8170)) + +Usability improvements: + +- Allow cycling option values at runtime ([#4411](https://github.com/helix-editor/helix/pull/4411), [#7240](https://github.com/helix-editor/helix/pull/7240), [#7877](https://github.com/helix-editor/helix/pull/7877)) +- Exit gracefully on termination signals ([#7236](https://github.com/helix-editor/helix/pull/7236)) +- Add plaintext matching fallback to tree-sitter pair matching ([#4288](https://github.com/helix-editor/helix/pull/4288)) +- Persist register selection in pending keymaps ([0e08349](https://github.com/helix-editor/helix/commit/0e08349)) +- Propagate the count and register to command palette commands ([b394997](https://github.com/helix-editor/helix/commit/b394997)) +- Auto indent on `insert_at_line_start` ([#5837](https://github.com/helix-editor/helix/pull/5837)) +- Add a config option to control whether LSP completions are automatically inserted on preview ([#7189](https://github.com/helix-editor/helix/pull/7189)) +- Add a config option for default line endings ([#5621](https://github.com/helix-editor/helix/pull/5621), [#7357](https://github.com/helix-editor/helix/pull/7357)) +- Allow ANSI colors in themes ([#5119](https://github.com/helix-editor/helix/pull/5119)) +- Match pairs that don't form a standalone tree-sitter node ([#7242](https://github.com/helix-editor/helix/pull/7242)) +- Allow indent sizes of up to 16 columns ([#7429](https://github.com/helix-editor/helix/pull/7429)) +- Improve performance of mapping positions through changes ([#7408](https://github.com/helix-editor/helix/pull/7408), [8d39a81](https://github.com/helix-editor/helix/commit/8d39a81), [#7471](https://github.com/helix-editor/helix/pull/7471)) +- Mark buffers created from stdin as modified ([#7431](https://github.com/helix-editor/helix/pull/7431)) +- Forcibly shut down uninitialized language servers ([#7449](https://github.com/helix-editor/helix/pull/7449)) +- Add filename completer for shell prompts ([#7569](https://github.com/helix-editor/helix/pull/7569)) +- Allow binding F13-F24 ([#7672](https://github.com/helix-editor/helix/pull/7672)) +- Resolve LSP code actions ([#7677](https://github.com/helix-editor/helix/pull/7677), [#8421](https://github.com/helix-editor/helix/pull/8421)) +- Save an undo checkpoint before accepting completions ([#7747](https://github.com/helix-editor/helix/pull/7747)) +- Include gitignored files in debugger completions ([#7936](https://github.com/helix-editor/helix/pull/7936)) +- Make editor remember the last search register ([#5244](https://github.com/helix-editor/helix/pull/5244)) +- Open directories with `goto_file` ([#7909](https://github.com/helix-editor/helix/pull/7909)) +- Use relative path to open buffer in `goto_file` (`gf`) ([#7965](https://github.com/helix-editor/helix/pull/7965)) +- Support `default` color in themes ([#8083](https://github.com/helix-editor/helix/pull/8083), [#8114](https://github.com/helix-editor/helix/pull/8114)) +- Toggle between relative and absolute line numbers when the terminal loses focus ([#7955](https://github.com/helix-editor/helix/pull/7955)) +- Lower default idle-timeout to 250ms ([060e73a](https://github.com/helix-editor/helix/commit/060e73a)) +- Allow theming diff gutters separately from other diff colors ([#8343](https://github.com/helix-editor/helix/pull/8343)) +- Style bold/italic/strikethrough in markdown doc popups ([#8385](https://github.com/helix-editor/helix/pull/8385)) +- Maintain the cursor position and view when splitting with `:hsplit`/`:vsplit` ([#8109](https://github.com/helix-editor/helix/pull/8109)) +- Accept `-` in macros outside of `<`/`>` ([#8475](https://github.com/helix-editor/helix/pull/8475)) +- Show all language servers for each language in `--health` ([#7315](https://github.com/helix-editor/helix/pull/7315)) +- Don't break on hyphens in `:reflow` ([#8569](https://github.com/helix-editor/helix/pull/8569)) + +Fixes: + +- Update diagnostics correctly on language server exit ([#7111](https://github.com/helix-editor/helix/pull/7111)) +- Fix off-by-one in `select_references_to_symbol_under_cursor` ([#7132](https://github.com/helix-editor/helix/pull/7132)) +- Extend selection with repeat-last-motion only if the original motion extended the selection ([#7159](https://github.com/helix-editor/helix/pull/7159)) +- Fix undefined behavior in the diff gutter ([#7227](https://github.com/helix-editor/helix/pull/7227)) +- Check that tab width is non-zero ([#7178](https://github.com/helix-editor/helix/pull/7178)) +- Fix styles being overwritten in table rows with multiple cells ([#7281](https://github.com/helix-editor/helix/pull/7281)) +- Add file for `--log` CLI arg in help text ([#7307](https://github.com/helix-editor/helix/pull/7307)) +- Fix underflow when repeating a completion that has a negative shift position ([#7322](https://github.com/helix-editor/helix/pull/7322)) +- Prefer longer matches in `select_next_sibling` and `select_prev_sibling` ([#7332](https://github.com/helix-editor/helix/pull/7332)) +- Preview scratch buffers in the jumplist picker ([#7331](https://github.com/helix-editor/helix/pull/7331)) +- Fix chunking by bytes in tree-sitter parsing ([#7417](https://github.com/helix-editor/helix/pull/7417)) +- Discard LSP publishDiagnostic from uninitialized servers ([#7467](https://github.com/helix-editor/helix/pull/7467)) +- Use negotiated position encoding for LSP workspace edits ([#7469](https://github.com/helix-editor/helix/pull/7469)) +- Fix error message for unknown gutter types in config ([#7534](https://github.com/helix-editor/helix/pull/7534)) +- Fix `:log-open` when `--log` CLI arg is specified ([#7573](https://github.com/helix-editor/helix/pull/7573), [#7585](https://github.com/helix-editor/helix/pull/7585)) +- Fix debouncing of LSP messages to fix the last message sticking around ([#7538](https://github.com/helix-editor/helix/pull/7538), [#8023](https://github.com/helix-editor/helix/pull/8023)) +- Fix crash when the current working directory is deleted ([#7185](https://github.com/helix-editor/helix/pull/7185)) +- Fix piping to Helix on macOS ([#5468](https://github.com/helix-editor/helix/pull/5468)) +- Fix crash when parsing overlapping injections ([#7621](https://github.com/helix-editor/helix/pull/7621)) +- Clear the statusline when the prompt is visible ([#7646](https://github.com/helix-editor/helix/pull/7646)) +- Fix range formatting error message typo ([#7823](https://github.com/helix-editor/helix/pull/7823)) +- Skip rendering gutters when gutter width exceeds view width ([#7821](https://github.com/helix-editor/helix/pull/7821)) +- Center the picker preview using visual lines ([#7837](https://github.com/helix-editor/helix/pull/7837)) +- Align view correctly for background buffers opened with `A-ret` ([#7691](https://github.com/helix-editor/helix/pull/7691)) +- Fix cursor resetting to block when quitting via a keybind ([#7931](https://github.com/helix-editor/helix/pull/7931)) +- Remove path completions for the `:new` command ([#8010](https://github.com/helix-editor/helix/pull/8010)) +- Use binary path resolved by `which` for formatter commands ([#8064](https://github.com/helix-editor/helix/pull/8064)) +- Handle crossterm's `hidden` modifier ([#8120](https://github.com/helix-editor/helix/pull/8120)) +- Clear completion when switching between windows with the mouse ([#8118](https://github.com/helix-editor/helix/pull/8118)) +- Eagerly remove the last picker (`'`) when the picker has many items ([#8127](https://github.com/helix-editor/helix/pull/8127)) +- Fix find commands for buffers with non-LF line-endings ([#8111](https://github.com/helix-editor/helix/pull/8111)) +- Detect the tmux clipboard provider on macOS ([#8182](https://github.com/helix-editor/helix/pull/8182)) +- Fix syntax highlighting in dynamic picker preview pane ([#8206](https://github.com/helix-editor/helix/pull/8206)) +- Recognize HTML code tags with attributes as code in markdown previews ([#8397](https://github.com/helix-editor/helix/pull/8397)) +- Fix multicursor snippet placeholder directions ([#8423](https://github.com/helix-editor/helix/pull/8423)) +- Only show diagnostic highlights when diagnostics are enabled for a language server ([#8551](https://github.com/helix-editor/helix/pull/8551)) + +Themes: + +- Improve the selection color in `ferra` ([#7138](https://github.com/helix-editor/helix/pull/7138)) +- Add `variable.other.member` theming to `spacebones_light` ([#7125](https://github.com/helix-editor/helix/pull/7125)) +- Update `autumn` and theme the soft-wrap indicator ([#7229](https://github.com/helix-editor/helix/pull/7229)) +- Add `gruvbox_dark_soft` ([#7139](https://github.com/helix-editor/helix/pull/7139)) +- Add `merionette` ([#7186](https://github.com/helix-editor/helix/pull/7186)) +- Add `zed_onedark` and `zed_onelight` ([#7250](https://github.com/helix-editor/helix/pull/7250)) +- Use light-gray for `onedarker` inlay hint theming ([#7433](https://github.com/helix-editor/helix/pull/7433)) +- Update the Nord theme to follow the style guidelines ([#7490](https://github.com/helix-editor/helix/pull/7490)) +- Tune `dark_plus` inlay hint colors ([#7611](https://github.com/helix-editor/helix/pull/7611)) +- Add `naysayer` ([#7570](https://github.com/helix-editor/helix/pull/7570)) +- Add `kaolin-dark`, `kaolin-light` and `kaolin-valley-dark` ([#7151](https://github.com/helix-editor/helix/pull/7151)) +- Fix selection highlighting in gruvbox variants ([#7717](https://github.com/helix-editor/helix/pull/7717)) +- Add soft-wrap indicator to `gruvbox` ([#7736](https://github.com/helix-editor/helix/pull/7736)) +- Add missing palette definitions in `everforest_dark` ([#7739](https://github.com/helix-editor/helix/pull/7739)) +- Increase diagnostics clarity in `pop-dark` ([#7702](https://github.com/helix-editor/helix/pull/7702)) +- Add `vim_dark_high_contrast` ([#7785](https://github.com/helix-editor/helix/pull/7785)) +- Add `new_moon` ([#7834](https://github.com/helix-editor/helix/pull/7834)) +- Add `yellowed` ([#7849](https://github.com/helix-editor/helix/pull/7849)) +- Improve comment readability for `autumn` ([#7939](https://github.com/helix-editor/helix/pull/7939)) +- Distinguish active bufferline buffer in `monokai` ([#7983](https://github.com/helix-editor/helix/pull/7983)) +- Update ruler colors in `nord` ([#7995](https://github.com/helix-editor/helix/pull/7995)) +- Update Catppuccin themes ([#8102](https://github.com/helix-editor/helix/pull/8102)) +- Add text focus scope and diagnostics undercurls for `nord` ([#8165](https://github.com/helix-editor/helix/pull/8165)) +- Add material theme collection ([#8211](https://github.com/helix-editor/helix/pull/8211)) +- Improve indent line color in `dracula` ([#8266](https://github.com/helix-editor/helix/pull/8266)) +- Clean up and refactor `papercolor` to use inheritance ([#8276](https://github.com/helix-editor/helix/pull/8276)) +- Fix `zenburn` inlay hint color ([#8278](https://github.com/helix-editor/helix/pull/8278)a) +- Fix picker crash when previewing an invalid range ([e9d0bd7](https://github.com/helix-editor/helix/commit/e9d0bd7)) +- Correctly center items in the picker preview ([13d4463](https://github.com/helix-editor/helix/commit/13d4463)) +- Add `cyan_light` ([#8293](https://github.com/helix-editor/helix/pull/8293), [#8587](https://github.com/helix-editor/helix/pull/8587)) +- Theme HTML tags in `onedark` ([#8409](https://github.com/helix-editor/helix/pull/8409)) +- Refine `darcula` and `darcula-solid` themes ([#8412](https://github.com/helix-editor/helix/pull/8412)) +- Improve `nord` highlights ([#8414](https://github.com/helix-editor/helix/pull/8414)) +- Add `nord-night` ([#8549](https://github.com/helix-editor/helix/pull/8549)) + +New languages: + +- Blueprint ([#7213](https://github.com/helix-editor/helix/pull/7213), [#8161](https://github.com/helix-editor/helix/pull/8161)) +- Forth ([#7256](https://github.com/helix-editor/helix/pull/7256), [#7334](https://github.com/helix-editor/helix/pull/7334)) +- t32 ([#7140](https://github.com/helix-editor/helix/pull/7140), [#7811](https://github.com/helix-editor/helix/pull/7811)) +- WebC ([#7290](https://github.com/helix-editor/helix/pull/7290)) +- Persistent DSL for Haskell ([#7261](https://github.com/helix-editor/helix/pull/7261)) +- F# ([#7619](https://github.com/helix-editor/helix/pull/7619), [#8024](https://github.com/helix-editor/helix/pull/8024)) +- Wren ([#7765](https://github.com/helix-editor/helix/pull/7765), [#7819](https://github.com/helix-editor/helix/pull/7819)) +- Unison ([#7724](https://github.com/helix-editor/helix/pull/7724)) +- Todo.txt ([#7835](https://github.com/helix-editor/helix/pull/7835)) +- Jinja and Handlebars ([#7233](https://github.com/helix-editor/helix/pull/7233)) +- Pod ([#7907](https://github.com/helix-editor/helix/pull/7907)) +- Strace ([#7928](https://github.com/helix-editor/helix/pull/7928)) +- Gemini ([#8070](https://github.com/helix-editor/helix/pull/8070)) +- GNU Assembler (GAS) ([#8291](https://github.com/helix-editor/helix/pull/8291)) +- JSON5 ([#8473](https://github.com/helix-editor/helix/pull/8473)) +- TEMPL ([#8540](https://github.com/helix-editor/helix/pull/8540)) + +Updated languages and queries: + +- Add one to the ruler numbers for git-commit ([#7072](https://github.com/helix-editor/helix/pull/7072)) +- Recognize XAML files as XML ([#7083](https://github.com/helix-editor/helix/pull/7083)) +- Recognize `Cargo.lock` as TOML ([#7095](https://github.com/helix-editor/helix/pull/7095)) +- Use Rust grammar for Cairo ([c6d1430](https://github.com/helix-editor/helix/commit/c6d1430)) +- Update tree-sitter-nickel ([#7059](https://github.com/helix-editor/helix/pull/7059), [#7551](https://github.com/helix-editor/helix/pull/7551)) +- Tune auto-pair characters for Nickel ([#7059](https://github.com/helix-editor/helix/pull/7059)) +- Recognize `Vagrantfile` as Ruby ([#7112](https://github.com/helix-editor/helix/pull/7112)) +- Recognize hidden justfiles as Just ([#7088](https://github.com/helix-editor/helix/pull/7088)) +- Update Java and TypeScript highlight queries ([#7145](https://github.com/helix-editor/helix/pull/7145)) +- Recognize `.zimrc` as Bash ([#7146](https://github.com/helix-editor/helix/pull/7146)) +- Recognize `.gir` as XML ([#7152](https://github.com/helix-editor/helix/pull/7152)) +- Update tree-sitter-scala ([#7147](https://github.com/helix-editor/helix/pull/7147)) +- Recognize make file-type as Makefile ([#7212](https://github.com/helix-editor/helix/pull/7212)) +- Update tree-sitter-verilog ([#7262](https://github.com/helix-editor/helix/pull/7262)) +- Update tree-sitter-cpp ([#7285](https://github.com/helix-editor/helix/pull/7285)) +- Support core mode for delve debugger ([#7300](https://github.com/helix-editor/helix/pull/7300)) +- Add Fortran comment injections ([#7305](https://github.com/helix-editor/helix/pull/7305)) +- Switch Vue language server to `vue-language-server` ([#7312](https://github.com/helix-editor/helix/pull/7312)) +- Update tree-sitter-sql ([#7387](https://github.com/helix-editor/helix/pull/7387), [#8464](https://github.com/helix-editor/helix/pull/8464)) +- Replace the MATLAB tre-sitter grammar ([#7388](https://github.com/helix-editor/helix/pull/7388), [#7442](https://github.com/helix-editor/helix/pull/7442), [#7491](https://github.com/helix-editor/helix/pull/7491), [#7493](https://github.com/helix-editor/helix/pull/7493), [#7511](https://github.com/helix-editor/helix/pull/7511), [#7532](https://github.com/helix-editor/helix/pull/7532), [#8040](https://github.com/helix-editor/helix/pull/8040)) +- Highlight TOML table headers ([#7441](https://github.com/helix-editor/helix/pull/7441)) +- Recognize `cppm` file-type as C++ ([#7492](https://github.com/helix-editor/helix/pull/7492)) +- Refactor ecma language queries into private and public queries ([#7207](https://github.com/helix-editor/helix/pull/7207)) +- Update tree-sitter-dart ([#7576](https://github.com/helix-editor/helix/pull/7576)) +- Add shebang for nushell files ([#7606](https://github.com/helix-editor/helix/pull/7606)) +- Recognize systemd files as INI ([#7592](https://github.com/helix-editor/helix/pull/7592)) +- Update TypeScript, TSX and Svelte grammars ([#6874](https://github.com/helix-editor/helix/pull/6874)) +- Enable inlay hints in the Svelte language server ([#7622](https://github.com/helix-editor/helix/pull/7622)) +- Recognize `Brewfile`s as Ruby ([#7629](https://github.com/helix-editor/helix/pull/7629)) +- Add more file-types for R ([#7633](https://github.com/helix-editor/helix/pull/7633)) +- Switch tree-sitter-perl to official upstream parser ([#7644](https://github.com/helix-editor/helix/pull/7644), [#7947](https://github.com/helix-editor/helix/pull/7947)) +- Fix predicate typo in comment highlights ([#7732](https://github.com/helix-editor/helix/pull/7732)) +- Update tree-sitter-prql ([#7771](https://github.com/helix-editor/helix/pull/7771)) +- Recognize `.gitf` as JSON ([#7781](https://github.com/helix-editor/helix/pull/7781)) +- Switch V language server to `v-analyzer` ([#7760](https://github.com/helix-editor/helix/pull/7760)) +- Add protobuf language servers ([#7796](https://github.com/helix-editor/helix/pull/7796)) +- Update tree-sitter-zig ([#7803](https://github.com/helix-editor/helix/pull/7803)) +- Update tree-sitter-hare ([#7784](https://github.com/helix-editor/helix/pull/7784)) +- Add Java indent queries ([#7844](https://github.com/helix-editor/helix/pull/7844)) +- Update tree-sitter-scheme ([979933b](https://github.com/helix-editor/helix/commit/979933b)) +- Recognize `scm` as Scheme instead of TSQ ([5707151](https://github.com/helix-editor/helix/commit/5707151)) +- Update tree-sitter-git-commit ([#7831](https://github.com/helix-editor/helix/pull/7831)) +- Update JavaScript, TypeScript and TSX grammars ([#7852](https://github.com/helix-editor/helix/pull/7852)) +- Update tree-sitter-nu ([#7873](https://github.com/helix-editor/helix/pull/7873)) +- Fix YAML indentation ([#6768](https://github.com/helix-editor/helix/pull/6768)) +- Add `csharp-ls`, Pyright, Pylyzer and add roots for Python ([#7897](https://github.com/helix-editor/helix/pull/7897), [#8032](https://github.com/helix-editor/helix/pull/8032)) +- Update tree-sitter-slint ([#7893](https://github.com/helix-editor/helix/pull/7893)) +- Recognize more ZSH file-types as Bash ([#7930](https://github.com/helix-editor/helix/pull/7930)) +- Recognize `star` extension as Starlark ([#7922](https://github.com/helix-editor/helix/pull/7922)) +- Fix inline HTML tag highlighting in markdown ([#7960](https://github.com/helix-editor/helix/pull/7960)) +- Update tree-sitter-robot ([#7970](https://github.com/helix-editor/helix/pull/7970)) +- Highlight Dart 3 `sealed` and `base` keywords ([#7974](https://github.com/helix-editor/helix/pull/7974)) +- Add configuration for `ltex-ls` to the default `languages.toml` ([#7838](https://github.com/helix-editor/helix/pull/7838)) +- Update tree-sitter-strace ([#8087](https://github.com/helix-editor/helix/pull/8087)) +- Update tree-sitter-gleam, enable auto-format ([#8085](https://github.com/helix-editor/helix/pull/8085)) +- Update tree-sitter-esdl ([#8222](https://github.com/helix-editor/helix/pull/8222)) +- Expand ignore file-types ([#8220](https://github.com/helix-editor/helix/pull/8220)) +- Recognize feed related formats as XML ([#8232](https://github.com/helix-editor/helix/pull/8232)) +- Improve YAML injections ([#8217](https://github.com/helix-editor/helix/pull/8217)) +- Add shebangs for TypeScript, Julia, Java and OCaml ([95e994a](https://github.com/helix-editor/helix/commit/95e994a)) +- Highlight abbreviations in Scheme ([ef23847](https://github.com/helix-editor/helix/commit/ef23847)) +- Remove backtic auto-pair in OCaml ([#8260](https://github.com/helix-editor/helix/pull/8260)) +- Recognize `flake.lock` as JSON ([#8304](https://github.com/helix-editor/helix/pull/8304)) +- Add Python test script injection for Nix ([b4494e1](https://github.com/helix-editor/helix/commit/b4494e1)) +- Fix Nix comment injection precedence ([37e48f4](https://github.com/helix-editor/helix/commit/37e48f4)) +- Recognize editorconfig files as INI ([#8308](https://github.com/helix-editor/helix/pull/8308)) +- Recognize `.babelrc` as JSON ([#8309](https://github.com/helix-editor/helix/pull/8309)) +- Switch Purescript to its own tree-sitter parser ([#8306](https://github.com/helix-editor/helix/pull/8306), [#8338](https://github.com/helix-editor/helix/pull/8338), [#8527](https://github.com/helix-editor/helix/pull/8527)) +- Update Unison highlights ([#8315](https://github.com/helix-editor/helix/pull/8315)) +- Recognize `.webmanifest` as JSON ([#8342](https://github.com/helix-editor/helix/pull/8342)) +- Recognize polkit policy files as XML ([#8369](https://github.com/helix-editor/helix/pull/8369)) +- Recognize polkit rules files as JavaScript ([#8370](https://github.com/helix-editor/helix/pull/8370)) +- Update Go highlight queries ([#8399](https://github.com/helix-editor/helix/pull/8399)) +- Add shebangs for Makefiles ([#8410](https://github.com/helix-editor/helix/pull/8410)) +- Add file-type associations from VSCode ([#8388](https://github.com/helix-editor/helix/pull/8388)) +- Add validation to JSON/CSS language server configs ([#8433](https://github.com/helix-editor/helix/pull/8433)) +- Add a configuration for the tailwind language server ([#8442](https://github.com/helix-editor/helix/pull/8442)) +- Add a configuration for the ansible language server ([#7973](https://github.com/helix-editor/helix/pull/7973)) +- Add a configuration for the GraphQL language server ([#8492](https://github.com/helix-editor/helix/pull/8492)) +- Indent while statements in Bash ([#8528](https://github.com/helix-editor/helix/pull/8528)) +- Update tree-sitter-haskell and queries ([#8558](https://github.com/helix-editor/helix/pull/8558)) + +Packaging: + +- Add an overlay to the Nix flake ([#7078](https://github.com/helix-editor/helix/pull/7078)) +- Check for `git` before fetching or building grammars ([#7320](https://github.com/helix-editor/helix/pull/7320)) +- Refactor Nix flake to use Crane ([#7763](https://github.com/helix-editor/helix/pull/7763)) +- Remove the aarch64 appimage from the release CI ([#7832](https://github.com/helix-editor/helix/pull/7832)) +- Add desktop and icon files to Nix flake output ([#7979](https://github.com/helix-editor/helix/pull/7979)) +- Build flake packages with the latest stable Rust ([#8133](https://github.com/helix-editor/helix/pull/8133)) + # 23.05 (2023-05-18) 23.05 is a smaller release focusing on fixes. There were 88 contributors in this release. Thank you all! diff --git a/VERSION b/VERSION index 527d78c51..f5f8bffe4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -23.05 \ No newline at end of file +23.10 \ No newline at end of file diff --git a/contrib/Helix.appdata.xml b/contrib/Helix.appdata.xml index 08f23b3e1..c455b242e 100644 --- a/contrib/Helix.appdata.xml +++ b/contrib/Helix.appdata.xml @@ -48,6 +48,9 @@ + + https://helix-editor.com/news/release-23-10-highlights/ + https://github.com/helix-editor/helix/releases/tag/23.05 From f6021dd0cdd8cf6795f024e396241cb0af2ca368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 26 Oct 2023 01:37:27 +0900 Subject: [PATCH 039/393] ci: Disable riscv release build (currently broken) --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b645d94c6..eceb57f46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,11 +70,11 @@ jobs: rust: stable target: aarch64-unknown-linux-gnu cross: true - - build: riscv64-linux - os: ubuntu-latest - rust: stable - target: riscv64gc-unknown-linux-gnu - cross: true + # - build: riscv64-linux + # os: ubuntu-latest + # rust: stable + # target: riscv64gc-unknown-linux-gnu + # cross: true - build: x86_64-macos os: macos-latest rust: stable From c24a67c0e4cd1f7c10ee86c7d7ccbbaae233cbe8 Mon Sep 17 00:00:00 2001 From: Ryan Mehri <52933714+rmehri01@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:39:22 -0700 Subject: [PATCH 040/393] Add rust html injection query (#8603) --- runtime/queries/rust/injections.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/queries/rust/injections.scm b/runtime/queries/rust/injections.scm index b29a5ad70..ae9e587fd 100644 --- a/runtime/queries/rust/injections.scm +++ b/runtime/queries/rust/injections.scm @@ -1,6 +1,12 @@ ([(line_comment) (block_comment)] @injection.content (#set! injection.language "comment")) +((macro_invocation + macro: (identifier) @_html (#eq? @_html "html") + (token_tree) @injection.content) + (#set! injection.language "html") + (#set! injection.include-children)) + ((macro_invocation (token_tree) @injection.content) (#set! injection.language "rust") From 5ce1c30f775ba74b2b061655aea4441d8beaa445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 26 Oct 2023 15:58:10 +0900 Subject: [PATCH 041/393] Revert "Pin tree-sitter to the 0.20.10 release (#8396)" We only reverted so that the latest release would use a stable tree-sitter version hosted on crates.io. We do want the improvements on nightly. This reverts commit 2ebcc4dbeb306cc285d47bd1d21d72c7e57ecb72. --- Cargo.lock | 3 +-- Cargo.toml | 2 +- helix-core/src/syntax.rs | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d10cd16f6..3a88401ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2260,8 +2260,7 @@ dependencies = [ [[package]] name = "tree-sitter" version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" +source = "git+https://github.com/tree-sitter/tree-sitter?rev=ab09ae20d640711174b8da8a654f6b3dec93da1a#ab09ae20d640711174b8da8a654f6b3dec93da1a" dependencies = [ "cc", "regex", diff --git a/Cargo.toml b/Cargo.toml index 7217cd3de..8ffe0fa7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,5 +35,5 @@ package.helix-tui.opt-level = 2 package.helix-term.opt-level = 2 [workspace.dependencies] -tree-sitter = { version = "0.20" } +tree-sitter = { version = "0.20", git = "https://github.com/tree-sitter/tree-sitter", rev = "ab09ae20d640711174b8da8a654f6b3dec93da1a" } nucleo = "0.2.0" diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 97a882249..881b45098 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1614,7 +1614,7 @@ impl<'a> Iterator for ChunksBytes<'a> { } pub struct RopeProvider<'a>(pub RopeSlice<'a>); -impl<'a> TextProvider<'a> for RopeProvider<'a> { +impl<'a> TextProvider<&'a [u8]> for RopeProvider<'a> { type I = ChunksBytes<'a>; fn text(&mut self, node: Node) -> Self::I { @@ -1628,7 +1628,7 @@ impl<'a> TextProvider<'a> for RopeProvider<'a> { struct HighlightIterLayer<'a> { _tree: Option, cursor: QueryCursor, - captures: RefCell>>>, + captures: RefCell, &'a [u8]>>>, config: &'a HighlightConfiguration, highlight_end_stack: Vec, scope_stack: Vec>, From ef1f4f31b6e0d8338a9f5b8932de9b07ac7bb0a0 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 26 Oct 2023 09:07:36 -0500 Subject: [PATCH 042/393] CI: Publish stable book before master (#8621) --- .github/workflows/gh-pages.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index b288e0f66..ae2e5835e 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -26,16 +26,16 @@ jobs: OUTDIR=$(basename ${{ github.ref }}) echo "OUTDIR=$OUTDIR" >> $GITHUB_ENV - - name: Deploy + - name: Deploy stable uses: peaceiris/actions-gh-pages@v3 + if: startswith(github.ref, 'refs/tags/') with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./book/book - destination_dir: ./${{ env.OUTDIR }} - - name: Deploy stable + - name: Deploy uses: peaceiris/actions-gh-pages@v3 - if: startswith(github.ref, 'refs/tags/') with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./book/book + destination_dir: ./${{ env.OUTDIR }} From 290666011971c79e36b5172eea66b315dc52e2c9 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Fri, 27 Oct 2023 01:27:42 +0200 Subject: [PATCH 043/393] Add typst language and lsp (#7474) Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 22 ++++++++ runtime/queries/typst/highlights.scm | 77 ++++++++++++++++++++++++++++ runtime/queries/typst/injections.scm | 6 +++ 4 files changed, 106 insertions(+) create mode 100644 runtime/queries/typst/highlights.scm create mode 100644 runtime/queries/typst/injections.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 6fdc6f115..58bc3d059 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -163,6 +163,7 @@ | tsx | ✓ | ✓ | ✓ | `typescript-language-server` | | twig | ✓ | | | | | typescript | ✓ | ✓ | ✓ | `typescript-language-server` | +| typst | ✓ | | | `typst-lsp` | | ungrammar | ✓ | | | | | unison | ✓ | | | | | uxntal | ✓ | | | | diff --git a/languages.toml b/languages.toml index 77c629e49..a6c9d5567 100644 --- a/languages.toml +++ b/languages.toml @@ -88,6 +88,7 @@ wgsl_analyzer = { command = "wgsl_analyzer" } yaml-language-server = { command = "yaml-language-server", args = ["--stdio"] } zls = { command = "zls" } blueprint-compiler = { command = "blueprint-compiler", args = ["lsp"] } +typst-lsp = { command = "typst-lsp" } [language-server.ansible-language-server] command = "ansible-language-server" @@ -2912,6 +2913,27 @@ roots = [] indent = { tab-width = 2, unit = " " } grammar = "html" +[[language]] +name = "typst" +scope = "source.typst" +injection-regex = "typst" +file-types = ["typst", "typ"] +roots = [] +comment-token = "//" +language-servers = ["typst-lsp"] +indent = { tab-width = 2, unit = " " } + +[language.auto-pairs] +'(' = ')' +'{' = '}' +'[' = ']' +'$' = '$' +'"' = '"' + +[[grammar]] +name = "typst" +source = { git = "https://github.com/uben0/tree-sitter-typst", rev = "e35aa22395fdde82bbc4b5700c324ce346dfc9e5" } + [[language]] name = "nunjucks" scope = "text.html.nunjucks" diff --git a/runtime/queries/typst/highlights.scm b/runtime/queries/typst/highlights.scm new file mode 100644 index 000000000..b422e05b3 --- /dev/null +++ b/runtime/queries/typst/highlights.scm @@ -0,0 +1,77 @@ +(call + item: (ident) @function) +(call + item: (field field: (ident) @function.method)) +(tagged field: (ident) @tag) +(field field: (ident) @tag) +(comment) @comment + +; CONTROL +(let "let" @keyword.storage.type) +(branch ["if" "else"] @keyword.control.conditional) +(while "while" @keyword.control.repeat) +(for ["for" "in"] @keyword.control.repeat) +(import "import" @keyword.control.import) +(as "as" @keyword.operator) +(include "include" @keyword.control.import) +(show "show" @keyword.control) +(set "set" @keyword.control) +(return "return" @keyword.control) +(flow ["break" "continue"] @keyword.control) + +; OPERATOR +(in ["in" "not"] @keyword.operator) +(and "and" @keyword.operator) +(or "or" @keyword.operator) +(not "not" @keyword.operator) +(sign ["+" "-"] @operator) +(add "+" @operator) +(sub "-" @operator) +(mul "*" @operator) +(div "/" @operator) +(cmp ["==" "<=" ">=" "!=" "<" ">"] @operator) +(fraction "/" @operator) +(fac "!" @operator) +(attach ["^" "_"] @operator) +(wildcard) @operator + +; VALUE +(raw_blck "```" @operator) @markup.raw.block +(raw_span "`" @operator) @markup.raw.block +(raw_blck lang: (ident) @tag) +(label) @tag +(ref) @tag +(number) @constant.numeric +(string) @string +(content ["[" "]"] @operator) +(bool) @constant.builtin.boolean +(builtin) @constant.builtin +(none) @constant.builtin +(auto) @constant.builtin +(ident) @variable +(call + item: (builtin) @function.builtin) + +; MARKUP +(item "-" @markup.list) +(term ["/" ":"] @markup.list) +(heading ["=" "==" "===" "====" "====="] @markup.heading.marker) @markup.heading +(url) @tag +(emph) @markup.italic +(strong) @markup.bold +(symbol) @constant.character +(shorthand) @constant.builtin +(quote) @markup.quote +(align) @operator +(letter) @constant.character +(linebreak) @constant.builtin + +(math "$" @operator) +"#" @operator +"end" @operator + +(escape) @constant.character.escape +["(" ")" "{" "}"] @punctuation.bracket +["," ";" ".." ":" "sep"] @punctuation.delimiter +"assign" @punctuation +(field "." @punctuation) diff --git a/runtime/queries/typst/injections.scm b/runtime/queries/typst/injections.scm new file mode 100644 index 000000000..8039b4cab --- /dev/null +++ b/runtime/queries/typst/injections.scm @@ -0,0 +1,6 @@ +(raw_blck + (blob) @injection.shebang @injection.content) + +(raw_blck + lang: (ident) @injection.language + (blob) @injection.content) \ No newline at end of file From 9eec9adb8fb299ea57dc6fa13f0c5d789dcdff73 Mon Sep 17 00:00:00 2001 From: Frans Skarman Date: Thu, 26 Oct 2023 23:32:49 +0000 Subject: [PATCH 044/393] Add LPF tree sitter (#8536) Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 12 ++++++++++++ runtime/queries/lpf/highlights.scm | 19 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 runtime/queries/lpf/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 58bc3d059..48d805bc7 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -89,6 +89,7 @@ | llvm | ✓ | ✓ | ✓ | | | llvm-mir | ✓ | ✓ | ✓ | | | llvm-mir-yaml | ✓ | | ✓ | | +| lpf | ✓ | | | | | lua | ✓ | ✓ | ✓ | `lua-language-server` | | make | ✓ | | | | | markdoc | ✓ | | | `markdoc-ls` | diff --git a/languages.toml b/languages.toml index a6c9d5567..d8207b3ed 100644 --- a/languages.toml +++ b/languages.toml @@ -934,6 +934,18 @@ indent = { tab-width = 2, unit = " " } name = "lean" source = { git = "https://github.com/Julian/tree-sitter-lean", rev = "d98426109258b266e1e92358c5f11716d2e8f638" } + +[[language]] +name = "lpf" +comment-token = "#" +scope = "source.lpf" +file-types = ["lpf"] +roots = [] + +[[grammar]] +name = "lpf" +source = { git = "https://gitlab.com/TheZoq2/tree-sitter-lpf", rev = "db7372e60c722ca7f12ab359e57e6bf7611ab126" } + [[language]] name = "julia" scope = "source.julia" diff --git a/runtime/queries/lpf/highlights.scm b/runtime/queries/lpf/highlights.scm new file mode 100644 index 000000000..836aef846 --- /dev/null +++ b/runtime/queries/lpf/highlights.scm @@ -0,0 +1,19 @@ +[ + "SYSCONFIG" + "BLOCK" + "LOCATE" + "COMP" + "FREQUENCY" + "PORT" + "IOBUF" +] @keyword + +["SITE"] @keyword.storage + +["="] @operator + +((number) @constant.numeric) + +((string) @string) +((line_comment) @comment) + From 553ffbcaa09847ec606539bddab8af1456450d73 Mon Sep 17 00:00:00 2001 From: Ryan Mehri <52933714+rmehri01@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:36:34 -0700 Subject: [PATCH 045/393] Use terminfo to reset terminal cursor style (#8591) --- helix-tui/src/backend/crossterm.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs index 52841f6ef..c55ab6bbd 100644 --- a/helix-tui/src/backend/crossterm.rs +++ b/helix-tui/src/backend/crossterm.rs @@ -32,10 +32,21 @@ fn vte_version() -> Option { } /// Describes terminal capabilities like extended underline, truecolor, etc. -#[derive(Copy, Clone, Debug, Default)] +#[derive(Clone, Debug)] struct Capabilities { /// Support for undercurled, underdashed, etc. has_extended_underlines: bool, + /// Support for resetting the cursor style back to normal. + reset_cursor_command: String, +} + +impl Default for Capabilities { + fn default() -> Self { + Self { + has_extended_underlines: false, + reset_cursor_command: "\x1B[0 q".to_string(), + } + } } impl Capabilities { @@ -54,6 +65,10 @@ impl Capabilities { || t.extended_cap("Su").is_some() || vte_version() >= Some(5102) || matches!(term_program().as_deref(), Some("WezTerm")), + reset_cursor_command: t + .utf8_string_cap(termini::StringCapability::CursorNormal) + .unwrap_or("\x1B[0 q") + .to_string(), }, } } @@ -154,7 +169,8 @@ where fn restore(&mut self, config: Config) -> io::Result<()> { // reset cursor shape - write!(self.buffer, "\x1B[0 q")?; + self.buffer + .write_all(self.capabilities.reset_cursor_command.as_bytes())?; if config.enable_mouse_capture { execute!(self.buffer, DisableMouseCapture)?; } From 4f1d414d9c04e611e60f1af5e69f2347a17bc6ce Mon Sep 17 00:00:00 2001 From: Gabriel Dinner-David <82682503+gabydd@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:40:16 -0400 Subject: [PATCH 046/393] switch to tree-sitter-ron (#8624) --- languages.toml | 5 +++- runtime/queries/ron/highlights.scm | 44 +++++++++++++++++++++++++++++- runtime/queries/ron/indents.scm | 13 ++++++++- runtime/queries/ron/injections.scm | 3 +- 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/languages.toml b/languages.toml index d8207b3ed..8b9b01e9c 100644 --- a/languages.toml +++ b/languages.toml @@ -1689,7 +1689,10 @@ file-types = ["ron"] roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } -grammar = "rust" + +[[grammar]] +name = "ron" +source = { git = "https://github.com/zee-editor/tree-sitter-ron", rev = "7762d709a0f7c1f9e269d0125a2e8a7a69006146" } [[language]] name = "robot" diff --git a/runtime/queries/ron/highlights.scm b/runtime/queries/ron/highlights.scm index 43766a4f8..1061d559a 100644 --- a/runtime/queries/ron/highlights.scm +++ b/runtime/queries/ron/highlights.scm @@ -1 +1,43 @@ -; inherits: rust \ No newline at end of file +; Literals +;------------ + +(string) @string +(boolean) @constant.builtin.boolean +(integer) @constant.numeric.integer +(float) @constant.numeric.float +(char) @constant.character + +; Structs +;------------ + +(enum_variant) @type.enum.variant +(struct_entry (_) @variable.other.member ":") +(struct_name (identifier)) @type + + + + +; Comments +;------------ + +(line_comment) @comment.line +(block_comment) @comment.block + + +; Punctuation +;------------ + +"," @punctuation.delimiter +":" @punctuation.delimiter + +"(" @punctuation.bracket +")" @punctuation.bracket +"[" @punctuation.bracket +"]" @punctuation.bracket +"{" @punctuation.bracket +"}" @punctuation.bracket + + +; Special +;------------ +(escape_sequence) @constant.character.escape diff --git a/runtime/queries/ron/indents.scm b/runtime/queries/ron/indents.scm index 43766a4f8..e73bf9224 100644 --- a/runtime/queries/ron/indents.scm +++ b/runtime/queries/ron/indents.scm @@ -1 +1,12 @@ -; inherits: rust \ No newline at end of file +[ + (array) + (map) + (tuple) + (struct) +] @indent + +[ + "}" + "]" + ")" +] @outdent diff --git a/runtime/queries/ron/injections.scm b/runtime/queries/ron/injections.scm index 43766a4f8..e4509a5fd 100644 --- a/runtime/queries/ron/injections.scm +++ b/runtime/queries/ron/injections.scm @@ -1 +1,2 @@ -; inherits: rust \ No newline at end of file +([(line_comment) (block_comment)] @injection.content + (#set! injection.language "comment")) From 99bf62a5607a096de863893ae5dcce3dc1b92678 Mon Sep 17 00:00:00 2001 From: Mehedi Rifat <78611383+rifoxide@users.noreply.github.com> Date: Fri, 27 Oct 2023 05:40:33 +0600 Subject: [PATCH 047/393] Theme: Add gruber-darker theme (#8598) --- runtime/themes/gruber-darker.toml | 114 ++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 runtime/themes/gruber-darker.toml diff --git a/runtime/themes/gruber-darker.toml b/runtime/themes/gruber-darker.toml new file mode 100644 index 000000000..355a3be83 --- /dev/null +++ b/runtime/themes/gruber-darker.toml @@ -0,0 +1,114 @@ +# Author : Mehedi Hasan +# Based on : https://github.com/rexim/gruber-darker-theme + +"attribute" = "fg0" +"keyword" = { fg = "yellow0", modifiers = ["bold"] } +"keyword.directive" = "quartz" +"namespace" = "quartz" +"punctuation" = "fg0" +"punctuation.delimiter" = "fg0" +"operator" = "fg0" +"special" = { fg = "yellow0", modifiers = ["bold"] } +"variable" = "fg0" +"variable.builtin" = { fg = "yellow0", modifiers = ["bold"] } +"variable.parameter" = "fg0" +"type" = "quartz" +"type.builtin" = "yellow0" +"constructor" = { fg = "quartz" } +"function" = "niagara0" +"function.builtin" = "yellow0" +"tag" = "niagara0" +"comment" = { fg = "brown0" } +"constant.character" = { fg = "green0" } +"constant.character.escape" = { fg = "yellow0" } +"constant.builtin" = { fg = "yellow0", modifiers = ["bold"] } +"string" = "green0" +"constant.numeric" = "wisteria" +"label" = "fg0" +"module" = "aqua1" + +"diff.plus" = "green1" +"diff.delta" = "orange1" +"diff.minus" = "red0" + +"warning" = { fg = "orange1", modifiers = ["bold"] } +"error" = { fg = "red0", modifiers = ["bold"] } +"info" = { fg = "aqua1", modifiers = ["bold"] } +"hint" = { fg = "blue0", modifiers = ["bold"] } + +"ui.background" = { bg = "bg0" } +"ui.linenr" = { fg = "bg4" } +"ui.linenr.selected" = { fg = "yellow0" } +"ui.cursorline" = { bg = "bg1" } + +"ui.statusline" = { fg = "fg0", bg = "bg1" } +"ui.statusline.normal" = { fg = "bg1", bg = "yellow0", modifiers = ["bold"] } +"ui.statusline.insert" = { fg = "bg1", bg = "blue0", modifiers = ["bold"] } +"ui.statusline.select" = { fg = "bg1", bg = "wisteria", modifiers = ["bold"] } +"ui.statusline.inactive" = { fg = "fg3", bg = "bg1" } + +"ui.bufferline" = { fg = "fg3", bg = "bg6" } +"ui.bufferline.active" = { fg = "fg0", bg = "bg7" } + +"ui.popup" = { bg = "bg6" } +"ui.window" = { fg = "bg1" } +"ui.help" = { bg = "bg1", fg = "fg0" } +"ui.text" = { fg = "fg0" } +"ui.text.focus" = { bg = "bg5", modifiers = ["bold"] } +"ui.selection" = { bg = "bg2" } +"ui.selection.primary" = { bg = "bg5" } +"ui.cursor.primary" = { bg = "fg0", fg = "niagara1" } +"ui.cursor.match" = { bg = "yellow1" } +"ui.menu" = { fg = "fg0", bg = "bg6" } +"ui.menu.selected" = { fg = "fg0", bg = "bg5", modifiers = ["bold"] } + +"ui.virtual.whitespace" = "bg8" +"ui.virtual.indent-guide" = "bg8" +"ui.virtual.ruler" = { bg = "bg1" } +"ui.virtual.inlay-hint" = { fg = "bg7" } +"ui.virtual.wrap" = { fg = "bg2" } + +"diagnostic.warning" = { underline = { color = "orange1", style = "dashed" } } +"diagnostic.error" = { underline = { color = "red3", style = "dashed" } } +"diagnostic.info" = { underline = { color = "aqua1", style = "dashed" } } +"diagnostic.hint" = { underline = { color = "blue0", style = "dashed" } } + +"markup.heading" = { fg = "aqua1", modifiers = ["bold"] } +"markup.bold" = { modifiers = ["bold"] } +"markup.italic" = { modifiers = ["italic"] } +"markup.strikethrough" = { modifiers = ["crossed_out"] } +"markup.link.url" = { fg = "green1", modifiers = ["underlined"] } +"markup.link.text" = "red3" +"markup.raw" = { fg = "fg0", bg = "bg8", modifiers = ["bold"] } + +[palette] +fg0 = "#e4e4ef" +fg1 = "#f4f4ff" +fg2 = "#f5f5f5" +fg3 = "#a89984" +bg0 = "#181818" +bg1 = "#282828" +bg2 = "#453d41" +bg4 = "#52494e" +bg5 = "#404040" +bg6 = "#232323" +bg7 = "#3f3f3f" +bg8 = "#2c2c2c" +red0 = "#f43841" +red1 = "#ff4f58" +red2 = "#2B0A0B" +red3 = "#fb4934" +green0 = "#73c936" +green1 = "#b8bb26" +yellow0 = "#ffdd33" +yellow1 = "#655814" +blue0 = "#5292c8" +orange0 = "#d65d0e" +orange1 = "#fe8019" +brown0 = "#cc8c3c" +quartz = "#95a99f" +niagara0 = "#96a6c8" +niagara1 = "#303540" +wisteria = "#9e95c7" +aqua1 = "#8ec07c" + From ab266b99e63813fd02e2b8d7619946a4f8db67d6 Mon Sep 17 00:00:00 2001 From: blt__ <63462729+blt-r@users.noreply.github.com> Date: Fri, 27 Oct 2023 03:40:49 +0400 Subject: [PATCH 048/393] Say "unindent" instead of "outdent" in tutor (#8623) --- runtime/tutor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/tutor b/runtime/tutor index f0de5a2d5..a781b5fe6 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -794,11 +794,11 @@ lines. = 7.3 INDENTING LINES = ================================================================= - Type > to indent a line and < to outdent it. + Type > to indent a line and < to unindent it. 1. Move the cursor to the line marked '-->' below. 2. Move down to the second line and type > to indent it. - 3. Move to the third line and type < to outdent it. + 3. Move to the third line and type < to unindent it. --> These lines are indented @@ -842,7 +842,7 @@ lines. * Type J to join lines in selection. - * Type < and > to indent / outdent lines. + * Type > and < to indent / unindent lines. * Press Ctrl-a to increment the selected number. * Press Ctrl-x to decrement the selected number. From f992c3b5972dbe2432ceb55bc8d47fed912f88bf Mon Sep 17 00:00:00 2001 From: RoloEdits Date: Thu, 26 Oct 2023 16:41:09 -0700 Subject: [PATCH 049/393] feat(highlights): add more comment highlights (#8564) --- runtime/queries/comment/highlights.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/queries/comment/highlights.scm b/runtime/queries/comment/highlights.scm index 6255d2858..9583f9c53 100644 --- a/runtime/queries/comment/highlights.scm +++ b/runtime/queries/comment/highlights.scm @@ -7,31 +7,31 @@ ; Hint level tags ((tag (name) @hint) - (#match? @hint "^(HINT|MARK)$")) + (#match? @hint "^(HINT|MARK|PASSED|STUB|MOCK)$")) ("text" @hint - (#match? @hint "^(HINT|MARK)$")) + (#match? @hint "^(HINT|MARK|PASSED|STUB|MOCK)$")) ; Info level tags ((tag (name) @info) - (#match? @info "^(INFO|NOTE|TODO)$")) + (#match? @info "^(INFO|NOTE|TODO|PERF|OPTIMIZE|PERFORMANCE|QUESTION|ASK)$")) ("text" @info - (#match? @info "^(INFO|NOTE|TODO)$")) + (#match? @info "^(INFO|NOTE|TODO|PERF|OPTIMIZE|PERFORMANCE|QUESTION|ASK)$")) ; Warning level tags ((tag (name) @warning) - (#match? @warning "^(HACK|WARN|WARNING)$")) + (#match? @warning "^(HACK|WARN|WARNING|TEST|TEMP)$")) ("text" @warning - (#match? @warning "^(HACK|WARN|WARNING)$")) + (#match? @warning "^(HACK|WARN|WARNING|TEST|TEMP)$")) ; Error level tags ((tag (name) @error) - (#match? @error "^(BUG|FIXME|ISSUE|XXX)$")) + (#match? @error "^(BUG|FIXME|ISSUE|XXX|FIX|SAFETY|FIXIT|FAILED|DEBUG)$")) ("text" @error - (#match? @error "^(BUG|FIXME|ISSUE|XXX)$")) + (#match? @error "^(BUG|FIXME|ISSUE|XXX|FIX|SAFETY|FIXIT|FAILED|DEBUG)$")) (tag (name) @ui.text From ef0c31db02cc1ade81b6d5097f1d05d7b3fa85e5 Mon Sep 17 00:00:00 2001 From: Triton171 Date: Sun, 29 Oct 2023 17:48:58 +0100 Subject: [PATCH 050/393] Fix precedence order of @align captures in indent computation (#8659) precedence when multiple occur on the same line in an indent query. --- helix-core/src/indent.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs index 6ccdc5952..abf45d6fa 100644 --- a/helix-core/src/indent.rs +++ b/helix-core/src/indent.rs @@ -271,7 +271,9 @@ impl Indentation { } /// Add an indent capture to this indent. - /// All the captures that are added in this way should be on the same line. + /// Only captures that apply to the same line should be added together in this way (otherwise use `add_line`) + /// and the captures should be added starting from the innermost tree-sitter node (currently this only matters + /// if multiple `@align` patterns occur on the same line). fn add_capture(&mut self, added: IndentCaptureType) { match added { IndentCaptureType::Indent => { @@ -295,7 +297,9 @@ impl Indentation { self.outdent = 0; } IndentCaptureType::Align(align) => { - self.align = Some(align); + if self.align.is_none() { + self.align = Some(align); + } } } } From 44e03fa41446f46c7be60a62acf6aa4131a62a4a Mon Sep 17 00:00:00 2001 From: Angus Dippenaar Date: Sun, 29 Oct 2023 17:53:15 +0100 Subject: [PATCH 051/393] add golangci-lint-langserver (#8656) * languages add golangci-lint-langserver * update docs --- book/src/generated/lang-support.md | 2 +- languages.toml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 48d805bc7..c879a9677 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -54,7 +54,7 @@ | git-rebase | ✓ | | | | | gleam | ✓ | ✓ | | `gleam` | | glsl | ✓ | ✓ | ✓ | | -| go | ✓ | ✓ | ✓ | `gopls` | +| go | ✓ | ✓ | ✓ | `gopls`, `golangci-lint-langserver` | | godot-resource | ✓ | | | | | gomod | ✓ | | | `gopls` | | gotmpl | ✓ | | | `gopls` | diff --git a/languages.toml b/languages.toml index 8b9b01e9c..24e20654d 100644 --- a/languages.toml +++ b/languages.toml @@ -117,6 +117,12 @@ functionTypeParameters = true parameterNames = true rangeVariableTypes = true +[language-server.golangci-lint-lsp] +command = "golangci-lint-langserver" + +[language-server.golangci-lint-lsp.config] +command = ["golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1"] + [language-server.rust-analyzer] command = "rust-analyzer" @@ -495,7 +501,7 @@ file-types = ["go"] roots = ["go.work", "go.mod"] auto-format = true comment-token = "//" -language-servers = [ "gopls" ] +language-servers = [ "gopls", "golangci-lint-lsp" ] # TODO: gopls needs utf-8 offsets? indent = { tab-width = 4, unit = "\t" } From 992b7a0c395b5c43e2fd4f6eee38bed8dda9721a Mon Sep 17 00:00:00 2001 From: John Careaga Date: Sun, 29 Oct 2023 20:28:06 -0400 Subject: [PATCH 052/393] Update idle-timeout in docs (#8661) --- book/src/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/src/configuration.md b/book/src/configuration.md index 3b78481e3..f8796245f 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -51,7 +51,7 @@ Its settings will be merged with the configuration directory `config.toml` and t | `auto-completion` | Enable automatic pop up of auto-completion | `true` | | `auto-format` | Enable automatic formatting on save | `true` | | `auto-save` | Enable automatic saving on the focus moving away from Helix. Requires [focus event support](https://github.com/helix-editor/helix/wiki/Terminal-Support) from your terminal | `false` | -| `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant | `400` | +| `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant | `250` | | `preview-completion-insert` | Whether to apply completion item instantly when selected | `true` | | `completion-trigger-len` | The min-length of word under cursor to trigger autocompletion | `2` | | `completion-replace` | Set to `true` to make completions always replace the entire word and not just the part before the cursor | `false` | From 7d7ed78681797d2dffa1070060e063a508a18ecf Mon Sep 17 00:00:00 2001 From: Jeffrey Gelens Date: Mon, 30 Oct 2023 19:28:55 +0100 Subject: [PATCH 053/393] Add MacPorts as installation option for MacOS (#8663) * Added MacPorts as installation option for MacOS * Added macports to ToC --- book/src/install.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/book/src/install.md b/book/src/install.md index 01858034f..dc028625b 100644 --- a/book/src/install.md +++ b/book/src/install.md @@ -13,6 +13,7 @@ - [AppImage](#appimage) - [macOS](#macos) - [Homebrew Core](#homebrew-core) + - [MacPorts](#macports) - [Windows](#windows) - [Winget](#winget) - [Scoop](#scoop) @@ -133,6 +134,12 @@ chmod +x helix-*.AppImage # change permission for executable mode brew install helix ``` +### MacPorts + +```sh +port install helix +``` + ## Windows Install on Windows using [Winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/), [Scoop](https://scoop.sh/), [Chocolatey](https://chocolatey.org/) From d0430f1c8166e5aad495474eb5c847a0df4dcb2f Mon Sep 17 00:00:00 2001 From: Ryan Mehri <52933714+rmehri01@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:03:38 -0700 Subject: [PATCH 054/393] Only render preview if picker has a preview function (#8667) --- helix-term/src/ui/picker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 2c41fc12d..0214a3910 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -795,7 +795,8 @@ impl Component for Picker { // | | | | // +---------+ +---------+ - let render_preview = self.show_preview && area.width > MIN_AREA_WIDTH_FOR_PREVIEW; + let render_preview = + self.show_preview && self.file_fn.is_some() && area.width > MIN_AREA_WIDTH_FOR_PREVIEW; let picker_width = if render_preview { area.width / 2 From 566f41635eae6b7533773d7b6b1aa89e980db8ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:38:41 +0900 Subject: [PATCH 055/393] build(deps): bump rustix from 0.38.20 to 0.38.21 (#8671) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a88401ed..4bd82e579 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1829,9 +1829,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.20" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.1", "errno", From ccc3085ad001d6d89e25ea854221d728bd0462a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 31 Oct 2023 11:55:12 +0900 Subject: [PATCH 056/393] ci: Use a shared cache across build workflow steps --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c6267b7c..e8c55fa4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,8 @@ jobs: override: true - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build" - name: Run cargo check run: cargo check @@ -40,6 +42,8 @@ jobs: uses: dtolnay/rust-toolchain@1.65 - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build" - name: Cache test tree-sitter grammar uses: actions/cache@v3 @@ -71,6 +75,8 @@ jobs: components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build" - name: Run cargo fmt run: cargo fmt --all --check @@ -94,6 +100,8 @@ jobs: uses: dtolnay/rust-toolchain@1.65 - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build" - name: Validate queries run: cargo xtask query-check From 403a1739cf8dbe74213074c7048c0036e16686ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:27:07 +0900 Subject: [PATCH 057/393] build(deps): bump serde from 1.0.189 to 1.0.190 (#8670) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4bd82e579..bbda804da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1869,18 +1869,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", From d171e23f72e9ada8ba5cd39516f91aa95392cea9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:27:15 +0900 Subject: [PATCH 058/393] build(deps): bump futures-util from 0.3.28 to 0.3.29 (#8673) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bbda804da..2c7127c60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -528,9 +528,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" @@ -545,15 +545,15 @@ dependencies = [ [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-core", "futures-task", From d32e052e0e5b03ff59c2d72b6eefa7fad37b8eac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:56:23 +0900 Subject: [PATCH 059/393] build(deps): bump ahash from 0.8.5 to 0.8.6 (#8669) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ helix-core/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c7127c60..2ad5c9ead 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "getrandom", @@ -2629,18 +2629,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.11" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c19fae0c8a9efc6a8281f2e623db8af1db9e57852e04cde3e754dd2dc29340f" +checksum = "dd66a62464e3ffd4e37bd09950c2b9dd6c4f8767380fabba0d523f9a775bc85a" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.11" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc56589e9ddd1f1c28d4b4b5c773ce232910a6bb67a70133d61c9e347585efe9" +checksum = "255c4596d41e6916ced49cfafea18727b24d67878fa180ddfd69b9df34fd1726" dependencies = [ "proc-macro2", "quote", diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index f0903f42b..8035333dd 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -30,7 +30,7 @@ once_cell = "1.18" arc-swap = "1" regex = "1" bitflags = "2.4" -ahash = "0.8.5" +ahash = "0.8.6" hashbrown = { version = "0.14.2", features = ["raw"] } dunce = "1.0" From 53bb62b318d3b898ac10f28f35df5dcb47da6bb3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:57:03 +0900 Subject: [PATCH 060/393] build(deps): bump tempfile from 3.8.0 to 3.8.1 (#8672) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- helix-loader/Cargo.toml | 2 +- helix-term/Cargo.toml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ad5c9ead..b5f25da4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1752,9 +1752,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] @@ -2059,13 +2059,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "rustix", "windows-sys 0.48.0", ] diff --git a/helix-loader/Cargo.toml b/helix-loader/Cargo.toml index 8e52e9725..54cb5b854 100644 --- a/helix-loader/Cargo.toml +++ b/helix-loader/Cargo.toml @@ -28,7 +28,7 @@ which = "4.4" # cloning/compiling tree-sitter grammars cc = { version = "1" } threadpool = { version = "1.0" } -tempfile = "3.8.0" +tempfile = "3.8.1" dunce = "1.0.4" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 72ddf360c..a84d372fd 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -80,4 +80,4 @@ helix-loader = { version = "0.6", path = "../helix-loader" } [dev-dependencies] smallvec = "1.11" indoc = "2.0.4" -tempfile = "3.8.0" +tempfile = "3.8.1" From a069b928973aad99b85dffb9d5ade7dae4b58c43 Mon Sep 17 00:00:00 2001 From: blinxen Date: Tue, 31 Oct 2023 23:09:48 +0100 Subject: [PATCH 061/393] Add missing license files for themes (#8684) --- runtime/themes/licenses/everforest.LICENSE | 21 +++++++++++++++++++ runtime/themes/licenses/serika-syntax.LICENSE | 21 +++++++++++++++++++ runtime/themes/licenses/sonokai.LICENSE | 21 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 runtime/themes/licenses/everforest.LICENSE create mode 100644 runtime/themes/licenses/serika-syntax.LICENSE create mode 100644 runtime/themes/licenses/sonokai.LICENSE diff --git a/runtime/themes/licenses/everforest.LICENSE b/runtime/themes/licenses/everforest.LICENSE new file mode 100644 index 000000000..546ed6343 --- /dev/null +++ b/runtime/themes/licenses/everforest.LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 sainnhe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/runtime/themes/licenses/serika-syntax.LICENSE b/runtime/themes/licenses/serika-syntax.LICENSE new file mode 100644 index 000000000..a88cd6fa3 --- /dev/null +++ b/runtime/themes/licenses/serika-syntax.LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 arturoalviar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/runtime/themes/licenses/sonokai.LICENSE b/runtime/themes/licenses/sonokai.LICENSE new file mode 100644 index 000000000..167e749cf --- /dev/null +++ b/runtime/themes/licenses/sonokai.LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 sainnhe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 1755c61d08b0a6f332eb8feee2e8d28bde162357 Mon Sep 17 00:00:00 2001 From: Omnikar Date: Thu, 2 Nov 2023 20:51:10 -0400 Subject: [PATCH 062/393] Swap system and primary clipboard registers (#8703) --- helix-view/src/register.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/helix-view/src/register.rs b/helix-view/src/register.rs index 0ebea5369..5592c6afd 100644 --- a/helix-view/src/register.rs +++ b/helix-view/src/register.rs @@ -75,8 +75,8 @@ impl Registers { self.clipboard_provider.as_ref(), self.inner.get(&name), match name { - '*' => ClipboardType::Clipboard, - '+' => ClipboardType::Selection, + '+' => ClipboardType::Clipboard, + '*' => ClipboardType::Selection, _ => unreachable!(), }, )), @@ -95,8 +95,8 @@ impl Registers { self.clipboard_provider.set_contents( values.join(NATIVE_LINE_ENDING.as_str()), match name { - '*' => ClipboardType::Clipboard, - '+' => ClipboardType::Selection, + '+' => ClipboardType::Clipboard, + '*' => ClipboardType::Selection, _ => unreachable!(), }, )?; @@ -118,8 +118,8 @@ impl Registers { '#' | '.' | '%' => Err(anyhow::anyhow!("Register {name} does not support pushing")), '*' | '+' => { let clipboard_type = match name { - '*' => ClipboardType::Clipboard, - '+' => ClipboardType::Selection, + '+' => ClipboardType::Clipboard, + '*' => ClipboardType::Selection, _ => unreachable!(), }; let contents = self.clipboard_provider.get_contents(clipboard_type)?; @@ -172,8 +172,8 @@ impl Registers { ('#', ""), ('.', ""), ('%', ""), - ('*', ""), - ('+', ""), + ('+', ""), + ('*', ""), ] .iter() .copied(), @@ -190,8 +190,8 @@ impl Registers { match name { '*' | '+' => { self.clear_clipboard(match name { - '*' => ClipboardType::Clipboard, - '+' => ClipboardType::Selection, + '+' => ClipboardType::Clipboard, + '*' => ClipboardType::Selection, _ => unreachable!(), }); self.inner.remove(&name); From ae6a0a9cfd377fbfa494760282498cf2ca322782 Mon Sep 17 00:00:00 2001 From: Arkady Rost Date: Fri, 3 Nov 2023 00:51:22 +0000 Subject: [PATCH 063/393] Adjusted ui.virtual.inlay-hint color for everblush theme (#8705) Co-authored-by: Arkady Rost <1239844+arkrost@users.noreply.github.com> --- runtime/themes/everblush.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/themes/everblush.toml b/runtime/themes/everblush.toml index edcdaf41b..b49bf0494 100644 --- a/runtime/themes/everblush.toml +++ b/runtime/themes/everblush.toml @@ -68,6 +68,7 @@ "ui.virtual.whitespace" = { fg = "comment" } "ui.virtual.wrap" = { fg = "comment" } "ui.virtual.indent-guide" = { fg = "comment" } +"ui.virtual.inlay-hint" = { fg = "comment" } "ui.window" = { fg = "black" } "error" = { fg = "red" } From 70bbbd7d193a7928c9b621af9a7e192ef8251f6b Mon Sep 17 00:00:00 2001 From: Joey Hain Date: Fri, 3 Nov 2023 14:21:01 -0700 Subject: [PATCH 064/393] add highlight scope for type parameters (#8660) * rust: add highlight scope for type parameters * handle optional type parameters --- book/src/themes.md | 1 + runtime/queries/rust/highlights.scm | 7 +++++++ runtime/queries/rust/locals.scm | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/book/src/themes.md b/book/src/themes.md index 661210765..a62c07fee 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -155,6 +155,7 @@ We use a similar set of scopes as - `type` - Types - `builtin` - Primitive types provided by the language (`int`, `usize`) + - `parameter` - Generic type parameters (`T`) - `enum` - `variant` - `constructor` diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index bf2fde499..47e57e800 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -9,6 +9,13 @@ ; Types ; ------- +(type_parameters + (type_identifier) @type.parameter) +(constrained_type_parameter + left: (type_identifier) @type.parameter) +(optional_type_parameter + name: (type_identifier) @type.parameter) + ; --- ; Primitives ; --- diff --git a/runtime/queries/rust/locals.scm b/runtime/queries/rust/locals.scm index 75e5d181c..cb75d1557 100644 --- a/runtime/queries/rust/locals.scm +++ b/runtime/queries/rust/locals.scm @@ -2,6 +2,12 @@ [ (function_item) + (struct_item) + (enum_item) + (union_item) + (type_item) + (trait_item) + (impl_item) (closure_expression) (block) ] @local.scope @@ -11,8 +17,15 @@ (parameter (identifier) @local.definition) +(type_parameters + (type_identifier) @local.definition) +(constrained_type_parameter + left: (type_identifier) @local.definition) +(optional_type_parameter + name: (type_identifier) @local.definition) + (closure_parameters (identifier) @local.definition) ; References (identifier) @local.reference - +(type_identifier) @local.reference From 5c325fe342c26f31df495ec478a1d427270e8e42 Mon Sep 17 00:00:00 2001 From: cgahr Date: Fri, 3 Nov 2023 22:21:54 +0100 Subject: [PATCH 065/393] replace kdl tree-sitter to fix highlighting (#8652) * replace kdl tree-sitter * kdl: adopt highlights for new tree-sitter * kdl: add indent queries * kdl: add textobjects * kdl: improve syntax highlighting * kdl: update lang-support * kdl: make indents more concise --------- Co-authored-by: Constantin Gahr --- book/src/generated/lang-support.md | 2 +- languages.toml | 2 +- runtime/queries/kdl/highlights.scm | 8 ++++---- runtime/queries/kdl/indents.scm | 3 +++ runtime/queries/kdl/textobjects.scm | 27 +++++++++++++++++++++++++++ 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 runtime/queries/kdl/indents.scm create mode 100644 runtime/queries/kdl/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index c879a9677..3b2a115f2 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -81,7 +81,7 @@ | jsx | ✓ | ✓ | ✓ | `typescript-language-server` | | julia | ✓ | ✓ | ✓ | `julia` | | just | ✓ | ✓ | ✓ | | -| kdl | ✓ | | | | +| kdl | ✓ | ✓ | ✓ | | | kotlin | ✓ | | | `kotlin-language-server` | | latex | ✓ | ✓ | | `texlab` | | lean | ✓ | | | `lean` | diff --git a/languages.toml b/languages.toml index 24e20654d..6e637be78 100644 --- a/languages.toml +++ b/languages.toml @@ -2340,7 +2340,7 @@ injection-regex = "kdl" [[grammar]] name = "kdl" -source = { git = "https://github.com/Unoqwy/tree-sitter-kdl", rev = "e1cd292c6d15df6610484e1d4b5c987ecad52373" } +source = { git = "https://github.com/amaanq/tree-sitter-kdl", rev = "3ca569b9f9af43593c24f9e7a21f02f43a13bb88" } [[language]] name = "xml" diff --git a/runtime/queries/kdl/highlights.scm b/runtime/queries/kdl/highlights.scm index d83bde19c..78e5acf49 100644 --- a/runtime/queries/kdl/highlights.scm +++ b/runtime/queries/kdl/highlights.scm @@ -1,12 +1,12 @@ -(comment) @comment (single_line_comment) @comment +(multi_line_comment) @comment (node - name: (identifier) @function) + (identifier) @variable) + (prop (identifier) @attribute) -(type) @type -(bare_identifier) @variable.other.member +(type (_) @type) @punctuation.bracket (keyword) @keyword diff --git a/runtime/queries/kdl/indents.scm b/runtime/queries/kdl/indents.scm new file mode 100644 index 000000000..bc2ffc15d --- /dev/null +++ b/runtime/queries/kdl/indents.scm @@ -0,0 +1,3 @@ +(node_children) @indent + + "}" @outdent diff --git a/runtime/queries/kdl/textobjects.scm b/runtime/queries/kdl/textobjects.scm new file mode 100644 index 000000000..7f9a562cc --- /dev/null +++ b/runtime/queries/kdl/textobjects.scm @@ -0,0 +1,27 @@ +(type (_) @test.inside) @test.around + +(node + children: (node_children)? @class.inside) @class.around + +(node + children: (node_children)? @function.inside) @function.around + +(node (identifier) @function.movement) + +[ + (single_line_comment) + (multi_line_comment) +] @comment.inside + +[ + (single_line_comment)+ + (multi_line_comment)+ +] @comment.around + +[ + (prop) + (value) +] @parameter.inside + +(value (type) ? (_) @parameter.inside @parameter.movement . ) @parameter.around + From 8dc197721bd6e7bb68e57ddeff0abf1aac067a1f Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 3 Nov 2023 19:34:54 -0500 Subject: [PATCH 066/393] Add an installation method field to the bug report template (#8711) We can guess the installation method from the version tag and platform in some cases but it would be useful to have this be explicit for the sake of debugging packager-specific problems. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 47fd3fe8a..52a4619fb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -55,6 +55,16 @@ body: placeholder: wezterm 20220101-133340-7edc5b5a validations: required: true + - type: input + id: installation-method + attributes: + label: Installation Method + description: > + How you installed Helix - from a package manager like Homebrew or the + AUR, built from source, downloaded a binary from the releases page, etc. + placeholder: "source / brew / nixpkgs / flake / releases page" + validations: + required: true - type: input id: helix-version attributes: From 10b178e94b0d3c44c56f5cd573ff65b3249aea78 Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Fri, 3 Nov 2023 20:35:38 -0400 Subject: [PATCH 067/393] swap yank command registers (#8708) #8703 swapped the `+` and `*` registers, but did not swap them in the corresponding yank commands. --- book/src/usage.md | 4 ++-- helix-term/src/commands.rs | 24 ++++++++++++------------ helix-term/src/commands/typed.rs | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/book/src/usage.md b/book/src/usage.md index e392e5e67..e01482193 100644 --- a/book/src/usage.md +++ b/book/src/usage.md @@ -59,8 +59,8 @@ Some registers have special behavior when read from and written to. | `#` | Selection indices (first selection is `1`, second is `2`, etc.) | This register is not writable | | `.` | Contents of the current selections | This register is not writable | | `%` | Name of the current file | This register is not writable | -| `*` | Reads from the system clipboard | Joins and yanks to the system clipboard | -| `+` | Reads from the primary clipboard | Joins and yanks to the primary clipboard | +| `+` | Reads from the system clipboard | Joins and yanks to the system clipboard | +| `*` | Reads from the primary clipboard | Joins and yanks to the primary clipboard | When yanking multiple selections to the clipboard registers, the selections are joined with newlines. Pasting from these registers will paste multiple diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 75df430a3..648aa96e8 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3897,12 +3897,12 @@ fn yank(cx: &mut Context) { } fn yank_to_clipboard(cx: &mut Context) { - yank_impl(cx.editor, '*'); + yank_impl(cx.editor, '+'); exit_select_mode(cx); } fn yank_to_primary_clipboard(cx: &mut Context) { - yank_impl(cx.editor, '+'); + yank_impl(cx.editor, '*'); exit_select_mode(cx); } @@ -3959,13 +3959,13 @@ fn yank_joined(cx: &mut Context) { fn yank_joined_to_clipboard(cx: &mut Context) { let line_ending = doc!(cx.editor).line_ending; - yank_joined_impl(cx.editor, line_ending.as_str(), '*'); + yank_joined_impl(cx.editor, line_ending.as_str(), '+'); exit_select_mode(cx); } fn yank_joined_to_primary_clipboard(cx: &mut Context) { let line_ending = doc!(cx.editor).line_ending; - yank_joined_impl(cx.editor, line_ending.as_str(), '+'); + yank_joined_impl(cx.editor, line_ending.as_str(), '*'); exit_select_mode(cx); } @@ -3982,12 +3982,12 @@ fn yank_primary_selection_impl(editor: &mut Editor, register: char) { } fn yank_main_selection_to_clipboard(cx: &mut Context) { - yank_primary_selection_impl(cx.editor, '*'); + yank_primary_selection_impl(cx.editor, '+'); exit_select_mode(cx); } fn yank_main_selection_to_primary_clipboard(cx: &mut Context) { - yank_primary_selection_impl(cx.editor, '+'); + yank_primary_selection_impl(cx.editor, '*'); exit_select_mode(cx); } @@ -4088,19 +4088,19 @@ pub(crate) fn paste_bracketed_value(cx: &mut Context, contents: String) { } fn paste_clipboard_after(cx: &mut Context) { - paste(cx.editor, '*', Paste::After, cx.count()); + paste(cx.editor, '+', Paste::After, cx.count()); } fn paste_clipboard_before(cx: &mut Context) { - paste(cx.editor, '*', Paste::Before, cx.count()); + paste(cx.editor, '+', Paste::Before, cx.count()); } fn paste_primary_clipboard_after(cx: &mut Context) { - paste(cx.editor, '+', Paste::After, cx.count()); + paste(cx.editor, '*', Paste::After, cx.count()); } fn paste_primary_clipboard_before(cx: &mut Context) { - paste(cx.editor, '+', Paste::Before, cx.count()); + paste(cx.editor, '*', Paste::Before, cx.count()); } fn replace_with_yanked(cx: &mut Context) { @@ -4138,11 +4138,11 @@ fn replace_with_yanked_impl(editor: &mut Editor, register: char, count: usize) { } fn replace_selections_with_clipboard(cx: &mut Context) { - replace_with_yanked_impl(cx.editor, '*', cx.count()); + replace_with_yanked_impl(cx.editor, '+', cx.count()); } fn replace_selections_with_primary_clipboard(cx: &mut Context) { - replace_with_yanked_impl(cx.editor, '+', cx.count()); + replace_with_yanked_impl(cx.editor, '*', cx.count()); } fn paste(editor: &mut Editor, register: char, pos: Paste, count: usize) { diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index abe6dd97e..e73433080 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -921,7 +921,7 @@ fn yank_main_selection_to_clipboard( return Ok(()); } - yank_primary_selection_impl(cx.editor, '*'); + yank_primary_selection_impl(cx.editor, '+'); Ok(()) } @@ -956,7 +956,7 @@ fn yank_joined_to_clipboard( let doc = doc!(cx.editor); let default_sep = Cow::Borrowed(doc.line_ending.as_str()); let separator = args.first().unwrap_or(&default_sep); - yank_joined_impl(cx.editor, separator, '*'); + yank_joined_impl(cx.editor, separator, '+'); Ok(()) } @@ -969,7 +969,7 @@ fn yank_main_selection_to_primary_clipboard( return Ok(()); } - yank_primary_selection_impl(cx.editor, '+'); + yank_primary_selection_impl(cx.editor, '*'); Ok(()) } @@ -985,7 +985,7 @@ fn yank_joined_to_primary_clipboard( let doc = doc!(cx.editor); let default_sep = Cow::Borrowed(doc.line_ending.as_str()); let separator = args.first().unwrap_or(&default_sep); - yank_joined_impl(cx.editor, separator, '+'); + yank_joined_impl(cx.editor, separator, '*'); Ok(()) } @@ -998,7 +998,7 @@ fn paste_clipboard_after( return Ok(()); } - paste(cx.editor, '*', Paste::After, 1); + paste(cx.editor, '+', Paste::After, 1); Ok(()) } @@ -1011,7 +1011,7 @@ fn paste_clipboard_before( return Ok(()); } - paste(cx.editor, '*', Paste::Before, 1); + paste(cx.editor, '+', Paste::Before, 1); Ok(()) } @@ -1024,7 +1024,7 @@ fn paste_primary_clipboard_after( return Ok(()); } - paste(cx.editor, '+', Paste::After, 1); + paste(cx.editor, '*', Paste::After, 1); Ok(()) } @@ -1037,7 +1037,7 @@ fn paste_primary_clipboard_before( return Ok(()); } - paste(cx.editor, '+', Paste::Before, 1); + paste(cx.editor, '*', Paste::Before, 1); Ok(()) } @@ -1050,7 +1050,7 @@ fn replace_selections_with_clipboard( return Ok(()); } - replace_with_yanked_impl(cx.editor, '*', 1); + replace_with_yanked_impl(cx.editor, '+', 1); Ok(()) } @@ -1063,7 +1063,7 @@ fn replace_selections_with_primary_clipboard( return Ok(()); } - replace_with_yanked_impl(cx.editor, '+', 1); + replace_with_yanked_impl(cx.editor, '*', 1); Ok(()) } From 2fddc2a4fcd3b8d9415e35994af3049d6960b23a Mon Sep 17 00:00:00 2001 From: MDeiml Date: Sun, 5 Nov 2023 13:04:20 +0100 Subject: [PATCH 068/393] Update markdown grammar to v0.1.6 --- languages.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 6e637be78..e3f9395bf 100644 --- a/languages.toml +++ b/languages.toml @@ -1383,7 +1383,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "markdown" -source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "fa6bfd51727e4bef99f7eec5f43947f73d64ea7d", subpath = "tree-sitter-markdown" } +source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "aaf76797aa8ecd9a5e78e0ec3681941de6c945ee", subpath = "tree-sitter-markdown" } [[language]] name = "markdown.inline" @@ -1395,7 +1395,7 @@ grammar = "markdown_inline" [[grammar]] name = "markdown_inline" -source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "fa6bfd51727e4bef99f7eec5f43947f73d64ea7d", subpath = "tree-sitter-markdown-inline" } +source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "aaf76797aa8ecd9a5e78e0ec3681941de6c945ee", subpath = "tree-sitter-markdown-inline" } [[language]] name = "dart" From a98ad137f9b0678ce9770aaa56a8bf8ca7c51d17 Mon Sep 17 00:00:00 2001 From: postsolar <120750161+postsolar@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:16:25 +0200 Subject: [PATCH 069/393] Update PureScript grammar (#8712) --- languages.toml | 2 +- runtime/queries/purescript/highlights.scm | 38 ++++++++++++++++++----- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/languages.toml b/languages.toml index e3f9395bf..9b7d93ed2 100644 --- a/languages.toml +++ b/languages.toml @@ -1142,7 +1142,7 @@ formatter = { command = "purs-tidy", args = ["format"] } [[grammar]] name = "purescript" -source = { git = "https://github.com/maskhjarna/tree-sitter-purescript", rev = "0e36a885a941078bf40e559026be425764dc27bf" } +source = { git = "https://github.com/postsolar/tree-sitter-purescript", rev = "593193b9bf0f46d5eee708a4e53044d2a9054897" } [[language]] name = "zig" diff --git a/runtime/queries/purescript/highlights.scm b/runtime/queries/purescript/highlights.scm index f559fd1ea..b110f3e01 100644 --- a/runtime/queries/purescript/highlights.scm +++ b/runtime/queries/purescript/highlights.scm @@ -3,15 +3,13 @@ (integer) @constant.numeric.integer (exp_negation) @constant.numeric.integer - (exp_literal (float)) @constant.numeric.float + (exp_literal (number)) @constant.numeric.float (char) @constant.character [ (string) (triple_quote_string) ] @string - (con_unit) @constant.builtin ; unit, as in () - (comment) @comment @@ -36,6 +34,10 @@ ; ---------------------------------------------------------------------------- ; Keywords, operators, includes + ; This needs to come before the other "else" in + ; order to be highlighted correctly + (class_instance "else" @keyword) + [ "if" "then" @@ -53,15 +55,20 @@ (operator) (constructor_operator) (type_operator) - (tycon_arrow) (qualified_module) ; grabs the `.` (dot), ex: import System.IO (all_names) + + ; `_` wildcards in if-then-else and case-of expressions, + ; as well as record updates and operator sections + (wildcard) "=" "|" "::" "∷" "=>" "⇒" + "<=" + "⇐" "->" "→" "<-" @@ -89,6 +96,7 @@ "newtype" "type" "as" + "hiding" "do" "ado" "forall" @@ -98,24 +106,40 @@ "infixr" ] @keyword + (type_role_declaration + "role" @keyword + role: (type_role) @keyword) + + (hole) @label ; ---------------------------------------------------------------------------- ; Functions and variables + (row_field (field_name) @variable.other.member) + (record_field (field_name) @variable.other.member) + (record_accessor (variable) @variable.other.member) + (exp_record_access (variable) @variable.other.member) + (signature name: (variable) @type) (function name: (variable) @function) + (class_instance (instance_name) @function) + (derive_declaration (instance_name) @function) ; true or false ((variable) @constant.builtin.boolean (#match? @constant.builtin.boolean "^(true|false)$")) - (variable) @variable + ; The former one works for `tree-sitter highlight` but not in Helix/Kakoune. + ; The latter two work in Helix (but not Kakoune) and are a good compromise between not highlighting anything at all + ; as an operator and leaving it to the child nodes, and highlighting everything as an operator. + (exp_ticked (_) @operator) + (exp_ticked (exp_name (variable) @operator)) + (exp_ticked (exp_name (qualified_variable (variable) @operator))) - (exp_infix (variable) @operator) ; consider infix functions as operators + (variable) @variable ("@" @namespace) ; "as" pattern operator, e.g. x@Constructor - ; ---------------------------------------------------------------------------- ; Types From f73e9a8d15fd5a87d472a49808baf42ba403f9bf Mon Sep 17 00:00:00 2001 From: Joey Hain Date: Sun, 5 Nov 2023 17:54:25 -0800 Subject: [PATCH 070/393] highlights: add type.parameter scope to several more languages (#8718) * typescript * go * haskell * ocaml * kotlin (+ bugfix) --- runtime/queries/_typescript/highlights.scm | 2 ++ runtime/queries/_typescript/locals.scm | 17 +++++++++++++++++ runtime/queries/go/highlights.scm | 16 ++++++++++++---- runtime/queries/go/locals.scm | 12 ++++++++++-- runtime/queries/haskell/highlights.scm | 2 +- runtime/queries/kotlin/highlights.scm | 5 ++++- runtime/queries/kotlin/locals.scm | 15 +++++++++++++++ runtime/queries/ocaml/highlights.scm | 2 ++ 8 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 runtime/queries/kotlin/locals.scm diff --git a/runtime/queries/_typescript/highlights.scm b/runtime/queries/_typescript/highlights.scm index a83b43475..f9a672667 100644 --- a/runtime/queries/_typescript/highlights.scm +++ b/runtime/queries/_typescript/highlights.scm @@ -107,6 +107,8 @@ ; Types ; ----- +(type_parameter + name: (type_identifier) @type.parameter) (type_identifier) @type (predefined_type) @type.builtin diff --git a/runtime/queries/_typescript/locals.scm b/runtime/queries/_typescript/locals.scm index fe13f21d3..041ad59d1 100644 --- a/runtime/queries/_typescript/locals.scm +++ b/runtime/queries/_typescript/locals.scm @@ -1,6 +1,18 @@ +; Scopes +;------- + +[ + (type_alias_declaration) + (class_declaration) + (interface_declaration) +] @local.scope + ; Definitions ;------------ +(type_parameter + name: (type_identifier) @local.definition) + ; Javascript and Typescript Treesitter grammars deviate when defining the ; tree structure for parameters, so we need to address them in each specific ; language instead of ecma. @@ -14,3 +26,8 @@ ; (i?: t = 1) // Invalid but still posible to hihglight. (optional_parameter (identifier) @local.definition) + +; References +;----------- + +(type_identifier) @local.reference diff --git a/runtime/queries/go/highlights.scm b/runtime/queries/go/highlights.scm index b45a11bee..fba2df99e 100644 --- a/runtime/queries/go/highlights.scm +++ b/runtime/queries/go/highlights.scm @@ -11,6 +11,18 @@ function: (selector_expression field: (field_identifier) @function.method)) + +; Types + +(type_parameter_list + (parameter_declaration + name: (identifier) @type.parameter)) + +((type_identifier) @type.builtin + (match? @type.builtin "^(any|bool|byte|comparable|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$")) + +(type_identifier) @type + ; Function definitions (function_declaration @@ -30,10 +42,6 @@ (parameter_declaration (identifier) @variable.parameter) (variadic_parameter_declaration (identifier) @variable.parameter) -((type_identifier) @type.builtin - (match? @type.builtin "^(any|bool|byte|comparable|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$")) - -(type_identifier) @type (type_spec name: (type_identifier) @constructor) (field_identifier) @variable.other.member diff --git a/runtime/queries/go/locals.scm b/runtime/queries/go/locals.scm index aae562571..14a6f3e43 100644 --- a/runtime/queries/go/locals.scm +++ b/runtime/queries/go/locals.scm @@ -1,9 +1,17 @@ ; Scopes -(block) @local.scope +[ + (function_declaration) + (type_declaration) + (block) +] @local.scope ; Definitions +(type_parameter_list + (parameter_declaration + name: (identifier) @local.definition)) + (parameter_declaration (identifier) @local.definition) (variadic_parameter_declaration (identifier) @local.definition) @@ -27,4 +35,4 @@ (identifier) @local.reference (field_identifier) @local.reference - +(type_identifier) @local.reference diff --git a/runtime/queries/haskell/highlights.scm b/runtime/queries/haskell/highlights.scm index 18c57c930..3d416de8d 100644 --- a/runtime/queries/haskell/highlights.scm +++ b/runtime/queries/haskell/highlights.scm @@ -124,7 +124,7 @@ ;; Types (type) @type -(type_variable) @type +(type_variable) @type.parameter (constructor) @constructor diff --git a/runtime/queries/kotlin/highlights.scm b/runtime/queries/kotlin/highlights.scm index 208a673f3..5b19f849e 100644 --- a/runtime/queries/kotlin/highlights.scm +++ b/runtime/queries/kotlin/highlights.scm @@ -244,7 +244,10 @@ . (identifier)) @namespace ((type_identifier) @type.builtin - (#match? @function.builtin "^(Byte|Short|Int|Long|UByte|UShort|UInt|ULong|Float|Double|Boolean|Char|String|Array|ByteArray|ShortArray|IntArray|LongArray|UByteArray|UShortArray|UIntArray|ULongArray|FloatArray|DoubleArray|BooleanArray|CharArray|Map|Set|List|EmptyMap|EmptySet|EmptyList|MutableMap|MutableSet|MutableList)$")) + (#match? @type.builtin "^(Byte|Short|Int|Long|UByte|UShort|UInt|ULong|Float|Double|Boolean|Char|String|Array|ByteArray|ShortArray|IntArray|LongArray|UByteArray|UShortArray|UIntArray|ULongArray|FloatArray|DoubleArray|BooleanArray|CharArray|Map|Set|List|EmptyMap|EmptySet|EmptyList|MutableMap|MutableSet|MutableList)$")) + +(type_parameter + (type_identifier) @type.parameter) (type_identifier) @type diff --git a/runtime/queries/kotlin/locals.scm b/runtime/queries/kotlin/locals.scm new file mode 100644 index 000000000..752ed995e --- /dev/null +++ b/runtime/queries/kotlin/locals.scm @@ -0,0 +1,15 @@ +; Scopes + +[ + (class_declaration) + (function_declaration) +] @local.scope + +; Definitions + +(type_parameter + (type_identifier) @local.definition) + +; References + +(type_identifier) @local.reference diff --git a/runtime/queries/ocaml/highlights.scm b/runtime/queries/ocaml/highlights.scm index a08b12670..9d3bf4c8b 100644 --- a/runtime/queries/ocaml/highlights.scm +++ b/runtime/queries/ocaml/highlights.scm @@ -8,6 +8,8 @@ [(class_name) (class_type_name) (type_constructor)] @type +(type_variable) @type.parameter + [(constructor_name) (tag)] @constructor ; Functions From 7bc564d3dcdee69555578bbec75d08e6ce227a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Mon, 6 Nov 2023 22:33:18 +0100 Subject: [PATCH 071/393] Theme: Papercolor: Add type.parameter (#8735) --- runtime/themes/papercolor-light.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/themes/papercolor-light.toml b/runtime/themes/papercolor-light.toml index ae104e17e..5c59d6f51 100644 --- a/runtime/themes/papercolor-light.toml +++ b/runtime/themes/papercolor-light.toml @@ -52,6 +52,7 @@ "type" = { fg = "bright2", modifiers = ["bold"] } "type.builtin" = { fg = "bright2", modifiers = ["bold"] } +"type.parameter" = { fg = "foreground" } "type.enum" = { fg = "foreground" } "type.enum.variant" = { fg = "foreground" } From e868678139bc8f4f5b14236c3c3c3f6aa4aab47b Mon Sep 17 00:00:00 2001 From: Yomain <40139584+yo-main@users.noreply.github.com> Date: Wed, 8 Nov 2023 19:38:17 +0100 Subject: [PATCH 072/393] Add command to move files with LSP support (#8584) * Added rename command * Added an error if the new path already exists * Fixed wrong command name being used * fixed clippy suggestions * removed didRenameFiles call, fixed early return due to path Err * added ':rnm' alias to ':rename' * code cleanup * formatting * removed debug line * cargo fmt * Improved new buffer error message Co-authored-by: Pascal Kuthe * Removed unnecessary path normalizing Co-authored-by: Pascal Kuthe * Update helix-term/src/commands/typed.rs Co-authored-by: Pascal Kuthe * Update helix-term/src/commands/typed.rs Co-authored-by: Pascal Kuthe * Update helix-term/src/commands/typed.rs Co-authored-by: Pascal Kuthe * Update helix-term/src/commands/typed.rs Co-authored-by: Pascal Kuthe * feat: change `rename` command to `move` * feat: add multi lsp support when moving files * feat: allow lsp calls with a custom timeout * feat: sending lsp file_changed event once file has moved --------- Co-authored-by: ontley Co-authored-by: ontley <67148677+ontley@users.noreply.github.com> Co-authored-by: Pascal Kuthe --- book/src/generated/typable-cmd.md | 1 + helix-lsp/src/client.rs | 76 +++++++++++++++++++++++++++- helix-term/src/commands/typed.rs | 84 ++++++++++++++++++++++++++++++- 3 files changed, 159 insertions(+), 2 deletions(-) diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index 4b737893d..6280d3c72 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -85,3 +85,4 @@ | `:reset-diff-change`, `:diffget`, `:diffg` | Reset the diff change at the cursor position. | | `:clear-register` | Clear given register. If no argument is provided, clear all registers. | | `:redraw` | Clear and re-render the whole UI | +| `:move` | Move the current buffer and its corresponding file to a different path | diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 341702c37..e6e1f8a03 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -401,12 +401,22 @@ impl Client { &self, params: R::Params, ) -> impl Future> + where + R::Params: serde::Serialize, + { + self.call_with_timeout::(params, self.req_timeout) + } + + fn call_with_timeout( + &self, + params: R::Params, + timeout_secs: u64, + ) -> impl Future> where R::Params: serde::Serialize, { let server_tx = self.server_tx.clone(); let id = self.next_request_id(); - let timeout_secs = self.req_timeout; async move { use std::time::Duration; @@ -548,6 +558,11 @@ impl Client { dynamic_registration: Some(true), relative_pattern_support: Some(false), }), + file_operations: Some(lsp::WorkspaceFileOperationsClientCapabilities { + will_rename: Some(true), + did_rename: Some(true), + ..Default::default() + }), ..Default::default() }), text_document: Some(lsp::TextDocumentClientCapabilities { @@ -700,6 +715,65 @@ impl Client { }) } + pub fn prepare_file_rename( + &self, + old_uri: &lsp::Url, + new_uri: &lsp::Url, + ) -> Option>> { + let capabilities = self.capabilities.get().unwrap(); + + // Return early if the server does not support willRename feature + match &capabilities.workspace { + Some(workspace) => match &workspace.file_operations { + Some(op) => { + op.will_rename.as_ref()?; + } + _ => return None, + }, + _ => return None, + } + + let files = vec![lsp::FileRename { + old_uri: old_uri.to_string(), + new_uri: new_uri.to_string(), + }]; + let request = self.call_with_timeout::( + lsp::RenameFilesParams { files }, + 5, + ); + + Some(async move { + let json = request.await?; + let response: Option = serde_json::from_value(json)?; + Ok(response.unwrap_or_default()) + }) + } + + pub fn did_file_rename( + &self, + old_uri: &lsp::Url, + new_uri: &lsp::Url, + ) -> Option>> { + let capabilities = self.capabilities.get().unwrap(); + + // Return early if the server does not support DidRename feature + match &capabilities.workspace { + Some(workspace) => match &workspace.file_operations { + Some(op) => { + op.did_rename.as_ref()?; + } + _ => return None, + }, + _ => return None, + } + + let files = vec![lsp::FileRename { + old_uri: old_uri.to_string(), + new_uri: new_uri.to_string(), + }]; + Some(self.notify::(lsp::RenameFilesParams { files })) + } + // ------------------------------------------------------------------------------------------- // Text document // ------------------------------------------------------------------------------------------- diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index e73433080..4148257fc 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -6,7 +6,8 @@ use crate::job::Job; use super::*; use helix_core::fuzzy::fuzzy_match; -use helix_core::{encoding, line_ending, shellwords::Shellwords}; +use helix_core::{encoding, line_ending, path::get_canonicalized_path, shellwords::Shellwords}; +use helix_lsp::{OffsetEncoding, Url}; use helix_view::document::DEFAULT_LANGUAGE_NAME; use helix_view::editor::{Action, CloseError, ConfigEvent}; use serde_json::Value; @@ -2408,6 +2409,80 @@ fn redraw( Ok(()) } +fn move_buffer( + cx: &mut compositor::Context, + args: &[Cow], + event: PromptEvent, +) -> anyhow::Result<()> { + if event != PromptEvent::Validate { + return Ok(()); + } + + ensure!(args.len() == 1, format!(":move takes one argument")); + let doc = doc!(cx.editor); + + let new_path = get_canonicalized_path(&PathBuf::from(args.first().unwrap().to_string())); + let old_path = doc + .path() + .ok_or_else(|| anyhow!("Scratch buffer cannot be moved. Use :write instead"))? + .clone(); + let old_path_as_url = doc.url().unwrap(); + let new_path_as_url = Url::from_file_path(&new_path).unwrap(); + + let edits: Vec<( + helix_lsp::Result, + OffsetEncoding, + String, + )> = doc + .language_servers() + .map(|lsp| { + ( + lsp.prepare_file_rename(&old_path_as_url, &new_path_as_url), + lsp.offset_encoding(), + lsp.name().to_owned(), + ) + }) + .filter(|(f, _, _)| f.is_some()) + .map(|(f, encoding, name)| (helix_lsp::block_on(f.unwrap()), encoding, name)) + .collect(); + + for (lsp_reply, encoding, name) in edits { + match lsp_reply { + Ok(edit) => { + if let Err(e) = apply_workspace_edit(cx.editor, encoding, &edit) { + log::error!( + ":move command failed to apply edits from lsp {}: {:?}", + name, + e + ); + }; + } + Err(e) => { + log::error!("LSP {} failed to treat willRename request: {:?}", name, e); + } + }; + } + + let doc = doc_mut!(cx.editor); + + doc.set_path(Some(new_path.as_path())); + if let Err(e) = std::fs::rename(&old_path, &new_path) { + doc.set_path(Some(old_path.as_path())); + bail!("Could not move file: {}", e); + }; + + doc.language_servers().for_each(|lsp| { + lsp.did_file_rename(&old_path_as_url, &new_path_as_url); + }); + + cx.editor + .language_servers + .file_event_handler + .file_changed(new_path); + + Ok(()) +} + pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ TypableCommand { name: "quit", @@ -3008,6 +3083,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ fun: redraw, signature: CommandSignature::none(), }, + TypableCommand { + name: "move", + aliases: &[], + doc: "Move the current buffer and its corresponding file to a different path", + fun: move_buffer, + signature: CommandSignature::positional(&[completers::filename]), + }, ]; pub static TYPABLE_COMMAND_MAP: Lazy> = From cb0bc25a9fc00c2b5c7450754d096bec39cd26e6 Mon Sep 17 00:00:00 2001 From: Triton171 Date: Wed, 8 Nov 2023 20:53:07 +0100 Subject: [PATCH 073/393] Add indent queries for scheme (and reuse them for common-lisp & racket). (#8720) --- book/src/generated/lang-support.md | 6 ++-- languages.toml | 1 + runtime/queries/common-lisp/indents.scm | 1 + runtime/queries/racket/indents.scm | 1 + runtime/queries/scheme/indents.scm | 43 +++++++++++++++++++++++++ 5 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 runtime/queries/common-lisp/indents.scm create mode 100644 runtime/queries/racket/indents.scm create mode 100644 runtime/queries/scheme/indents.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 3b2a115f2..9c55b4a05 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -16,7 +16,7 @@ | clojure | ✓ | | | `clojure-lsp` | | cmake | ✓ | ✓ | ✓ | `cmake-language-server` | | comment | ✓ | | | | -| common-lisp | ✓ | | | `cl-lsp` | +| common-lisp | ✓ | | ✓ | `cl-lsp` | | cpon | ✓ | | ✓ | | | cpp | ✓ | ✓ | ✓ | `clangd` | | crystal | ✓ | ✓ | | `crystalline` | @@ -128,7 +128,7 @@ | python | ✓ | ✓ | ✓ | `pylsp` | | qml | ✓ | | ✓ | `qmlls` | | r | ✓ | | | `R` | -| racket | ✓ | | | `racket` | +| racket | ✓ | | ✓ | `racket` | | regex | ✓ | | | | | rego | ✓ | | | `regols` | | rescript | ✓ | ✓ | | `rescript-language-server` | @@ -140,7 +140,7 @@ | rust | ✓ | ✓ | ✓ | `rust-analyzer` | | sage | ✓ | ✓ | | | | scala | ✓ | | ✓ | `metals` | -| scheme | ✓ | | | | +| scheme | ✓ | | ✓ | | | scss | ✓ | | | `vscode-css-language-server` | | slint | ✓ | | ✓ | `slint-lsp` | | smithy | ✓ | | | `cs` | diff --git a/languages.toml b/languages.toml index 9b7d93ed2..11df7d247 100644 --- a/languages.toml +++ b/languages.toml @@ -1278,6 +1278,7 @@ roots = [] file-types = ["rkt", "rktd", "rktl", "scrbl"] shebangs = ["racket"] comment-token = ";" +indent = { tab-width = 2, unit = " " } language-servers = [ "racket" ] grammar = "scheme" diff --git a/runtime/queries/common-lisp/indents.scm b/runtime/queries/common-lisp/indents.scm new file mode 100644 index 000000000..e11eb7881 --- /dev/null +++ b/runtime/queries/common-lisp/indents.scm @@ -0,0 +1 @@ +; inherits: scheme diff --git a/runtime/queries/racket/indents.scm b/runtime/queries/racket/indents.scm new file mode 100644 index 000000000..e11eb7881 --- /dev/null +++ b/runtime/queries/racket/indents.scm @@ -0,0 +1 @@ +; inherits: scheme diff --git a/runtime/queries/scheme/indents.scm b/runtime/queries/scheme/indents.scm new file mode 100644 index 000000000..b00b29652 --- /dev/null +++ b/runtime/queries/scheme/indents.scm @@ -0,0 +1,43 @@ +; This roughly follows the description at: https://github.com/ds26gte/scmindent#how-subforms-are-indented + +; Exclude literals in the first patterns, since different rules apply for them. +; Similarly, exclude certain keywords (detected by a regular expression). +; If a list has 2 elements on the first line, it is aligned to the second element. +(list . (_) @first . (_) @anchor + (#same-line? @first @anchor) + (#set! "scope" "tail") + (#not-kind-eq? @first "boolean") (#not-kind-eq? @first "character") (#not-kind-eq? @first "string") (#not-kind-eq? @first "number") + (#not-match? @first "def.*|let.*|set!")) @align +; If the first element in a list is also a list and on a line by itself, the outer list is aligned to it +(list . (list) @anchor . + (#set! "scope" "tail") + (#not-kind-eq? @first "boolean") (#not-kind-eq? @first "character") (#not-kind-eq? @first "string") (#not-kind-eq? @first "number")) @align +(list . (list) @anchor . (_) @second + (#not-same-line? @anchor @second) + (#set! "scope" "tail") + (#not-kind-eq? @first "boolean") (#not-kind-eq? @first "character") (#not-kind-eq? @first "string") (#not-kind-eq? @first "number") + (#not-match? @first "def.*|let.*|set!")) @align +; If the first element in a list is not a list and on a line by itself, the outer list is aligned to +; it plus 1 additional space. This cannot currently be modelled exactly by our indent queries, +; but the following is equivalent, assuming that: +; - the indent width is 2 (the default for scheme) +; - There is no space between the opening parenthesis of the list and the first element +(list . (_) @first . + (#not-kind-eq? @first "boolean") (#not-kind-eq? @first "character") (#not-kind-eq? @first "string") (#not-kind-eq? @first "number") + (#not-match? @first "def.*|let.*|set!")) @indent +(list . (_) @first . (_) @second + (#not-same-line? @first @second) + (#not-kind-eq? @first "boolean") (#not-kind-eq? @first "character") (#not-kind-eq? @first "string") (#not-kind-eq? @first "number") + (#not-match? @first "def.*|let.*|set!")) @indent + +; If the first element in a list is a literal, align the list to it +(list . [(boolean) (character) (string) (number)] @anchor + (#set! "scope" "tail")) @align + +; If the first element is among a set of predefined keywords, align the list to this element +; plus 1 space (using the same workaround as above for now). This is a simplification since actually +; the second line of the list should be indented by 2 spaces more in some cases. Supporting this would +; be possible but require significantly more patterns. +(list . (symbol) @first + (#match? @first "def.*|let.*|set!")) @indent + From 676ab0c1f392888a3dd44e3c6b84ac4b15dde59e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:12:45 +0900 Subject: [PATCH 074/393] build(deps): bump serde from 1.0.190 to 1.0.191 (#8740) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b5f25da4b..ea167d3ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1869,18 +1869,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "a834c4821019838224821468552240d4d95d14e751986442c816572d39a080c9" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "46fa52d5646bce91b680189fe5b1c049d2ea38dabb4e2e7c8d00ca12cfbfbcfd" dependencies = [ "proc-macro2", "quote", From 91bdceb8b607300516c041977881f94014ae7cde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:12:54 +0900 Subject: [PATCH 075/393] build(deps): bump serde_json from 1.0.107 to 1.0.108 (#8744) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea167d3ce..2c83a0997 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1889,9 +1889,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", From aac7bd9b08c72af161684cefc56fc1a3e59b5b1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:13:03 +0900 Subject: [PATCH 076/393] build(deps): bump libc from 0.2.149 to 0.2.150 (#8741) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- helix-term/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c83a0997..82bb2e6ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1433,9 +1433,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index a84d372fd..c6374de54 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -69,7 +69,7 @@ grep-searcher = "0.1.11" [target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100 signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } -libc = "0.2.149" +libc = "0.2.150" [target.'cfg(target_os = "macos")'.dependencies] crossterm = { version = "0.27", features = ["event-stream", "use-dev-tty"] } From 4229583631e0aedf6571e0479f574b5efd2eb98a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:13:32 +0900 Subject: [PATCH 077/393] build(deps): bump futures-executor from 0.3.28 to 0.3.29 (#8743) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82bb2e6ee..e1df49f49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -534,9 +534,9 @@ checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", From 6ab774da0b473c36a437d90abcdac3558353d32e Mon Sep 17 00:00:00 2001 From: mydumpfire <134539278+mydumpfire@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:56:57 +0700 Subject: [PATCH 078/393] grammars.nix: allow the user to apply overlays (#8749) You can now apply overlays to the grammar derivations via `grammarOverlays`. Also, the `src` in the derivation is now properly unpacked to the build directory, allowing the user to mutate the source files if they want to. --- grammars.nix | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/grammars.nix b/grammars.nix index 9ca0cf3d6..843fa02ad 100644 --- a/grammars.nix +++ b/grammars.nix @@ -5,6 +5,7 @@ runCommand, yj, includeGrammarIf ? _: true, + grammarOverlays ? [], ... }: let # HACK: nix < 2.6 has a bug in the toml parser, so we convert to JSON @@ -48,22 +49,22 @@ then sourceGitHub else sourceGit; in - stdenv.mkDerivation rec { + stdenv.mkDerivation { # see https://github.com/NixOS/nixpkgs/blob/fbdd1a7c0bc29af5325e0d7dd70e804a972eb465/pkgs/development/tools/parsing/tree-sitter/grammar.nix pname = "helix-tree-sitter-${grammar.name}"; version = grammar.source.rev; - src = - if builtins.hasAttr "subpath" grammar.source - then "${source}/${grammar.source.subpath}" - else source; + src = source; + sourceRoot = if builtins.hasAttr "subpath" grammar.source then + "source/${grammar.source.subpath}" + else + "source"; - dontUnpack = true; dontConfigure = true; FLAGS = [ - "-I${src}/src" + "-Isrc" "-g" "-O3" "-fPIC" @@ -76,13 +77,13 @@ buildPhase = '' runHook preBuild - if [[ -e "$src/src/scanner.cc" ]]; then - $CXX -c "$src/src/scanner.cc" -o scanner.o $FLAGS - elif [[ -e "$src/src/scanner.c" ]]; then - $CC -c "$src/src/scanner.c" -o scanner.o $FLAGS + if [[ -e src/scanner.cc ]]; then + $CXX -c src/scanner.cc -o scanner.o $FLAGS + elif [[ -e src/scanner.c ]]; then + $CC -c src/scanner.c -o scanner.o $FLAGS fi - $CC -c "$src/src/parser.c" -o parser.o $FLAGS + $CC -c src/parser.c -o parser.o $FLAGS $CXX -shared -o $NAME.so *.o ls -al @@ -105,15 +106,17 @@ ''; }; grammarsToBuild = builtins.filter includeGrammarIf gitGrammars; - builtGrammars = - builtins.map (grammar: { - inherit (grammar) name; - artifact = buildGrammar grammar; - }) - grammarsToBuild; - grammarLinks = - builtins.map (grammar: "ln -s ${grammar.artifact}/${grammar.name}.so $out/${grammar.name}.so") - builtGrammars; + builtGrammars = builtins.map (grammar: { + inherit (grammar) name; + value = buildGrammar grammar; + }) grammarsToBuild; + extensibleGrammars = + lib.makeExtensible (self: builtins.listToAttrs builtGrammars); + overlayedGrammars = lib.pipe extensibleGrammars + (builtins.map (overlay: grammar: grammar.extend overlay) grammarOverlays); + grammarLinks = lib.mapAttrsToList + (name: artifact: "ln -s ${artifact}/${name}.so $out/${name}.so") + (lib.filterAttrs (n: v: lib.isDerivation v) overlayedGrammars); in runCommand "consolidated-helix-grammars" {} '' mkdir -p $out From 172ef2fa9f2322b3a82729c584ede6cb84879b91 Mon Sep 17 00:00:00 2001 From: blt__ <63462729+blt-r@users.noreply.github.com> Date: Mon, 13 Nov 2023 02:04:03 +0400 Subject: [PATCH 079/393] Highlight meson_options.txt as a meson file (#8794) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 11df7d247..7d4326a1d 100644 --- a/languages.toml +++ b/languages.toml @@ -1943,7 +1943,7 @@ source = { git = "https://github.com/ap29600/tree-sitter-odin", rev = "b219207e4 name = "meson" scope = "source.meson" injection-regex = "meson" -file-types = ["meson.build"] +file-types = ["meson.build", "meson_options.txt"] roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } From 23fea46815371a8e1a0fa340be34d80624cd9bcc Mon Sep 17 00:00:00 2001 From: Ambuj Singh <97109381+that-ambuj@users.noreply.github.com> Date: Mon, 13 Nov 2023 03:34:36 +0530 Subject: [PATCH 080/393] theme: Add Theme poimandres (#8759) * theme: Add Theme poimandres * theme: inherit `poimandres_storm` from `poimandres` with minor tweaks * fix(theme): rename `crossed-out` to `crossed_out` * fix(theme:poimandres): improve contrast of selection color for regular variant --- runtime/themes/poimandres.toml | 113 +++++++++++++++++++++++++++ runtime/themes/poimandres_storm.toml | 19 +++++ 2 files changed, 132 insertions(+) create mode 100644 runtime/themes/poimandres.toml create mode 100644 runtime/themes/poimandres_storm.toml diff --git a/runtime/themes/poimandres.toml b/runtime/themes/poimandres.toml new file mode 100644 index 000000000..5dbc799d5 --- /dev/null +++ b/runtime/themes/poimandres.toml @@ -0,0 +1,113 @@ +# Author: Ambuj Kumar +# Ported from: https://github.com/drcmda/poimandres-theme + +attribute = { fg = "desaturatedBlue", modifiers = ["italic"] } +keyword = "brightMint" +"keyword.directive" = "gray" +"keyword.storage.type" = "desaturatedBlue" +"keyword.storage.modifier" = "lowerMint" +"keyword.other" = "brightMint" +"keyword.operator" = "desaturatedBlue" +namespace = "lightBlue" +punctuation = "gray" +"punctuation.bracket" = "desaturatedBlue" +operator = "desaturatedBlue" +special = "desaturatedBlue" +variable = "offWhite" +"variable.parameter" = { fg = "offWhite" } +"variable.builtin" = { fg = "lightBlue", modifiers = ["italic"] } +"variable.other" = "offWhite" +type = { fg = "gray.c0" } +"type.builtin" = { fg = "desaturatedBlue" } +constructor = "lightBlue" +function = "lightBlue" +"function.method" = { fg = "lightBlue" } +tag = "brightMint" +comment = { fg = "darkerGray.b0", modifiers = ["italic"] } +constant = "brightMint" +"constant.character.escape" = { fg = "offWhite" } +"constant.numeric" = { fg = "brightMint" } +"constant.builtin" = { fg = "hotRed" } +label = { fg = "gray.c0" } +string = { fg = "brightMint" } + +# Markup +"markup.heading" = { fg = "brightMint" } +"markup.bold" = { fg = "bluishGrayBrighter", modifiers = ["bold"] } +"markup.italic" = { fg = "bluishGrayBrighter", modifiers = ["italic"] } +"markup.strikethrough" = { modifiers = ["italic", "crossed_out"] } + +# UI +"markup.link.url" = { fg = "lightBlue", modifiers = ["underlined"] } +"markup.link.text" = { fg = "lightBlue", modifiers = ["underlined"] } +"markup.raw" = { fg = "lightBlue" } + +"ui.background" = { bg = "bg" } +"ui.background.separator" = { fg = "darkerGray" } +"ui.linenr" = "darkerGray.50" +"ui.linenr.selected" = "offWhite" +"ui.cursor" = { bg = "gray", fg = "bg" } +"ui.cursor.match" = { bg = "focus" } +"ui.cursorline" = { bg = "#242837" } + +"ui.popup" = { bg = "#20232d" } +"ui.window" = "gray" + +"ui.text" = "gray" +"ui.text.focus" = { fg = "offWhite", bg = "focus", modifiers = ["bold"] } +"ui.text.inactive" = "darkerGray" +"ui.virtual" = { fg = "darkerGray.b0" } +"ui.virtual.indent-guide" = "#303442" + +"ui.selection" = { bg = "focus" } +"ui.selection.primary" = { bg = "selection" } + +"ui.menu" = { fg = "offWhite", bg = "bg" } +"ui.menu.selected" = { fg = "bg", bg = "gray" } +"ui.menu.scroll" = { fg = "gray", bg = "bg" } + +"ui.statusline" = { fg = "offWhite", bg = "selection" } +"ui.statusline.inactive" = { fg = "lightBlue", bg = "bg" } +"ui.statusline.normal" = { bg = "lightBlue", fg = "bg", modifiers = ["bold"] } +"ui.statusline.insert" = { bg = "brightMint", fg = "bg", modifiers = ["bold"] } +"ui.statusline.select" = { bg = "hotRed", fg = "bg", modifiers = ["bold"] } + +"diagnostic.hint" = { underline = { color = "lowerMint", style = "curl" } } +"diagnostic.info" = { underline = { color = "lightBlue", style = "curl" } } +"diagnostic.warning" = { underline = { color = "brightYellow", style = "curl" } } +"diagnostic.error" = { underline = { color = "hotRed", style = "curl" } } + +hint = "lowerMint" +info = "lightBlue" +warning = "brightYellow" +error = "hotRed" + +# Version Control +"diff.plus" = "lowerMint" +"diff.minus" = "hotRed" +"diff.delta" = "lightBlue" + +[palette] +brightYellow = "#fffac2" +brightMint = "#5DE4c7" +lowerMint = "#5fb3a1" +blueishGreen = "#42675A" +lowerBlue = "#89ddff" +lightBlue = "#ADD7FF" +desaturatedBlue = "#91B4D5" +bluishGrayBrighter = "#7390AA" +hotRed = "#d0679d" +pink = "#f087bd" +gray = "#a6accd" +"gray.c0" = "#98a0c2" +darkerGray = "#767c9d" +"darkerGray.50" = "#404559" +"darkerGray.b0" = "#6c7494" +bluishGray = "#506477" +focus = "#303340" +bg = "#1b1e28" +offWhite = "#e4f0fb" +selection = "#30354a" +white = "#ffffff" +black = "#000000" +transparent = "#00000000" diff --git a/runtime/themes/poimandres_storm.toml b/runtime/themes/poimandres_storm.toml new file mode 100644 index 000000000..123122070 --- /dev/null +++ b/runtime/themes/poimandres_storm.toml @@ -0,0 +1,19 @@ +# Author: Ambuj Kumar +# Ported from: https://github.com/drcmda/poimandres-theme + +inherits = "poimandres" + +"ui.cursorline" = { bg = "#303747" } +"ui.popup" = { bg = "#2a303c" } +"ui.virtual.indent-guide" = "#3a4151" + +[palette] +"gray.c0" = "#98a2c4" +darkerGray = "#868cad" +"darkerGray.50" = "#4f576d" +"darkerGray.b0" = "#818cae" +bluishGray = "#607487" +focus = "#404350" +bg = "#252b37" +selection = "#3d455c" +black = "#101010" From 5ec53c02224557935a0e955c99e021943a372fd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:55:57 +0900 Subject: [PATCH 081/393] build(deps): bump tokio from 1.33.0 to 1.34.0 (#8811) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- helix-lsp/Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1df49f49..1f4c04020 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1535,14 +1535,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2009,9 +2009,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -2184,9 +2184,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -2203,9 +2203,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml index 0b181a845..50b296b37 100644 --- a/helix-lsp/Cargo.toml +++ b/helix-lsp/Cargo.toml @@ -25,7 +25,7 @@ lsp-types = { version = "0.94" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" -tokio = { version = "1.33", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] } +tokio = { version = "1.34", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] } tokio-stream = "0.1.14" which = "4.4" parking_lot = "0.12.1" From 13386a47865f7cf857dbd78dbfd107e0e2fa9bd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:56:13 +0900 Subject: [PATCH 082/393] build(deps): bump smallvec from 1.11.1 to 1.11.2 (#8808) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1f4c04020..6d8c7166d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1986,9 +1986,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smartstring" From 8b2d97eb56d6cffcc6ce235d6a6bf2d56055fe4b Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 13 Nov 2023 09:24:24 -0500 Subject: [PATCH 083/393] Default 'roots' field of language config Previously roots needed to be specified by every language and `[]` was used as an explicit default. Root files don't make sense for every language (for example TOML) so I think we should allow languages to not explicitly mention the key and have the `[]` default automatically. --- helix-core/src/syntax.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 881b45098..36a1e5c97 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -101,7 +101,8 @@ pub struct LanguageConfiguration { pub file_types: Vec, // filename extension or ends_with? #[serde(default)] pub shebangs: Vec, // interpreter(s) associated with language - pub roots: Vec, // these indicate project roots <.git, Cargo.toml> + #[serde(default)] + pub roots: Vec, // these indicate project roots <.git, Cargo.toml> pub comment_token: Option, pub text_width: Option, pub soft_wrap: Option, From 69a0df929a1cfbe0a313e328b90ebcfa7c655be4 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 13 Nov 2023 10:13:54 -0500 Subject: [PATCH 084/393] Remove 'roots' keys with default value from languages.toml --- languages.toml | 142 ------------------------------------------------- 1 file changed, 142 deletions(-) diff --git a/languages.toml b/languages.toml index 7d4326a1d..8761f90ad 100644 --- a/languages.toml +++ b/languages.toml @@ -249,7 +249,6 @@ name = "toml" scope = "source.toml" injection-regex = "toml" file-types = ["toml", "poetry.lock", "Cargo.lock"] -roots = [] comment-token = "#" language-servers = [ "taplo" ] indent = { tab-width = 2, unit = " " } @@ -263,7 +262,6 @@ name = "awk" scope = "source.awk" injection-regex = "awk" file-types = ["awk", "gawk", "nawk", "mawk"] -roots = [] comment-token = "#" language-servers = [ "awk-language-server" ] indent = { tab-width = 2, unit = " " } @@ -278,7 +276,6 @@ scope = "source.proto" injection-regex = "protobuf" file-types = ["proto"] language-servers = [ "bufls", "pbkit" ] -roots = [] comment-token = "//" indent = { tab-width = 2, unit = " " } @@ -307,7 +304,6 @@ scope = "source.fish" injection-regex = "fish" file-types = ["fish"] shebangs = ["fish"] -roots = [] comment-token = "#" indent = { tab-width = 4, unit = " " } @@ -321,7 +317,6 @@ scope = "source.mint" injection-regex = "mint" file-types = ["mint"] shebangs = [] -roots = [] comment-token = "//" language-servers = [ "mint" ] indent = { tab-width = 2, unit = " " } @@ -351,7 +346,6 @@ file-types = [ "composer.lock", ".watchmanconfig" ] -roots = [] language-servers = [ "vscode-json-language-server" ] auto-format = true indent = { tab-width = 2, unit = " " } @@ -366,7 +360,6 @@ name = "json5" scope = "source.json5" injection-regex = "json5" file-types = ["json5"] -roots = [] language-servers = [] comment-token = "//" indent = { tab-width = 4, unit = " " } @@ -381,7 +374,6 @@ name = "c" scope = "source.c" injection-regex = "c" file-types = ["c"] # TODO: ["h"] -roots = [] comment-token = "//" language-servers = [ "clangd" ] indent = { tab-width = 2, unit = " " } @@ -418,7 +410,6 @@ name = "cpp" scope = "source.cpp" injection-regex = "cpp" file-types = ["cc", "hh", "c++", "cpp", "hpp", "h", "ipp", "tpp", "cxx", "hxx", "ixx", "txx", "ino", "C", "H", "cu", "cuh", "cppm", "h++", "ii", "inl", { suffix = ".hpp.in" }, { suffix = ".h.in" }] -roots = [] comment-token = "//" language-servers = [ "clangd" ] indent = { tab-width = 2, unit = " " } @@ -551,7 +542,6 @@ name = "gomod" scope = "source.gomod" injection-regex = "gomod" file-types = ["go.mod"] -roots = [] auto-format = true comment-token = "//" language-servers = [ "gopls" ] @@ -566,7 +556,6 @@ name = "gotmpl" scope = "source.gotmpl" injection-regex = "gotmpl" file-types = ["gotmpl"] -roots = [] comment-token = "//" language-servers = [ "gopls" ] indent = { tab-width = 2, unit = " " } @@ -580,7 +569,6 @@ name = "gowork" scope = "source.gowork" injection-regex = "gowork" file-types = ["go.work"] -roots = [] auto-format = true comment-token = "//" language-servers = [ "gopls" ] @@ -597,7 +585,6 @@ injection-regex = "(js|javascript)" language-id = "javascript" file-types = ["js", "mjs", "cjs", "rules", "es6", "pac", "jakefile"] shebangs = ["node"] -roots = [] comment-token = "//" language-servers = [ "typescript-language-server" ] indent = { tab-width = 2, unit = " " } @@ -624,7 +611,6 @@ scope = "source.jsx" injection-regex = "jsx" language-id = "javascriptreact" file-types = ["jsx"] -roots = [] comment-token = "//" language-servers = [ "typescript-language-server" ] indent = { tab-width = 2, unit = " " } @@ -637,7 +623,6 @@ injection-regex = "(ts|typescript)" file-types = ["ts", "mts", "cts"] language-id = "typescript" shebangs = ["deno", "ts-node"] -roots = [] language-servers = [ "typescript-language-server" ] indent = { tab-width = 2, unit = " " } @@ -651,7 +636,6 @@ scope = "source.tsx" injection-regex = "(tsx)" # |typescript language-id = "typescriptreact" file-types = ["tsx"] -roots = [] language-servers = [ "typescript-language-server" ] indent = { tab-width = 2, unit = " " } @@ -664,7 +648,6 @@ name = "css" scope = "source.css" injection-regex = "css" file-types = ["css", "scss"] -roots = [] language-servers = [ "vscode-css-language-server" ] auto-format = true indent = { tab-width = 2, unit = " " } @@ -678,7 +661,6 @@ name = "scss" scope = "source.scss" injection-regex = "scss" file-types = ["scss"] -roots = [] language-servers = [ "vscode-css-language-server" ] auto-format = true indent = { tab-width = 2, unit = " " } @@ -692,7 +674,6 @@ name = "html" scope = "text.html.basic" injection-regex = "html" file-types = ["html", "htm", "shtml", "xhtml", "xht", "jsp", "asp", "aspx", "jshtm", "volt", "rhtml"] -roots = [] language-servers = [ "vscode-html-language-server" ] auto-format = true indent = { tab-width = 2, unit = " " } @@ -723,7 +704,6 @@ scope = "source.nickel" injection-regex = "nickel" file-types = ["ncl"] shebangs = [] -roots = [] comment-token = "#" language-servers = [ "nls" ] indent = { tab-width = 2, unit = " " } @@ -744,7 +724,6 @@ scope = "source.nix" injection-regex = "nix" file-types = ["nix"] shebangs = [] -roots = [] comment-token = "#" language-servers = [ "nil" ] indent = { tab-width = 2, unit = " " } @@ -794,7 +773,6 @@ file-types = [ "Gymfile" ] shebangs = ["ruby"] -roots = [] comment-token = "#" language-servers = [ "solargraph" ] indent = { tab-width = 2, unit = " " } @@ -849,7 +827,6 @@ file-types = [ "zshrc_Apple_Terminal" ] shebangs = ["sh", "bash", "dash", "zsh"] -roots = [] comment-token = "#" language-servers = [ "bash-language-server" ] indent = { tab-width = 2, unit = " " } @@ -877,7 +854,6 @@ name = "twig" scope = "source.twig" injection-regex = "twig" file-types = ["twig"] -roots = [] indent = { tab-width = 2, unit = " " } [[grammar]] @@ -889,7 +865,6 @@ name = "latex" scope = "source.tex" injection-regex = "tex" file-types = ["tex", "sty", "cls", "Rd", "bbx", "cbx"] -roots = [] comment-token = "%" language-servers = [ "texlab" ] indent = { tab-width = 4, unit = "\t" } @@ -903,7 +878,6 @@ name = "bibtex" scope = "source.bib" injection-regex = "bib" file-types = ["bib"] -roots = [] comment-token = "%" language-servers = [ "texlab" ] indent = { tab-width = 4, unit = "\t" } @@ -946,7 +920,6 @@ name = "lpf" comment-token = "#" scope = "source.lpf" file-types = ["lpf"] -roots = [] [[grammar]] name = "lpf" @@ -985,7 +958,6 @@ name = "ledger" scope = "source.ledger" injection-regex = "ledger" file-types = ["ldg", "ledger", "journal"] -roots = [] comment-token = ";" indent = { tab-width = 4, unit = " " } @@ -998,7 +970,6 @@ name = "beancount" scope = "source.beancount" injection-regex = "beancount" file-types = ["beancount", "bean"] -roots = [] comment-token = ";" indent = { tab-width = 2, unit = " " } @@ -1012,7 +983,6 @@ scope = "source.ocaml" injection-regex = "ocaml" file-types = ["ml"] shebangs = ["ocaml", "ocamlrun", "ocamlscript"] -roots = [] comment-token = "(**)" language-servers = [ "ocamllsp" ] indent = { tab-width = 2, unit = " " } @@ -1032,7 +1002,6 @@ name = "ocaml-interface" scope = "source.ocaml.interface" file-types = ["mli"] shebangs = [] -roots = [] comment-token = "(**)" language-servers = [ "ocamllsp" ] indent = { tab-width = 2, unit = " " } @@ -1067,7 +1036,6 @@ name = "svelte" scope = "source.svelte" injection-regex = "svelte" file-types = ["svelte"] -roots = [] indent = { tab-width = 2, unit = " " } language-servers = [ "svelteserver" ] @@ -1092,7 +1060,6 @@ source = { git = "https://github.com/ikatyang/tree-sitter-vue", rev = "91fe27547 name = "yaml" scope = "source.yaml" file-types = ["yml", "yaml"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } language-servers = [ "yaml-language-server", "ansible-language-server" ] @@ -1120,7 +1087,6 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "d7 name = "haskell-persistent" scope = "source.persistentmodels" file-types = ["persistentmodels"] -roots = [] comment-token = "--" indent = { tab-width = 2, unit = " " } @@ -1186,7 +1152,6 @@ source = { git = "https://github.com/maxxnino/tree-sitter-zig", rev = "0d08703e4 [[language]] name = "prolog" scope = "source.prolog" -roots = [] file-types = ["pl", "prolog"] shebangs = ["swipl"] comment-token = "%" @@ -1196,7 +1161,6 @@ language-servers = [ "swipl" ] name = "tsq" scope = "source.tsq" file-types = ["tsq"] -roots = [] comment-token = ";" injection-regex = "tsq" indent = { tab-width = 2, unit = " " } @@ -1209,7 +1173,6 @@ source = { git = "https://github.com/the-mikedavis/tree-sitter-tsq", rev = "48b5 name = "cmake" scope = "source.cmake" file-types = ["cmake", "CMakeLists.txt"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } language-servers = [ "cmake-language-server" ] @@ -1225,7 +1188,6 @@ scope = "source.make" file-types = ["Makefile", "makefile", "make", "mk", "mak", "GNUmakefile", "OCamlMakefile"] shebangs = ["make", "gmake"] injection-regex = "(make|makefile|Makefile|mk)" -roots = [] comment-token = "#" indent = { tab-width = 4, unit = "\t" } @@ -1237,7 +1199,6 @@ source = { git = "https://github.com/alemuller/tree-sitter-make", rev = "a4b9187 name = "glsl" scope = "source.glsl" file-types = ["glsl", "vert", "tesc", "tese", "geom", "frag", "comp" ] -roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } injection-regex = "glsl" @@ -1251,7 +1212,6 @@ name = "perl" scope = "source.perl" file-types = ["pl", "pm", "t", "psgi", "raku", "rakumod", "rakutest", "rakudoc", "nqp", "p6", "pl6", "pm6"] shebangs = ["perl"] -roots = [] comment-token = "#" language-servers = [ "perlnavigator" ] indent = { tab-width = 2, unit = " " } @@ -1264,7 +1224,6 @@ source = { git = "https://github.com/tree-sitter-perl/tree-sitter-perl", rev = " name = "pod" scope = "source.pod" injection-regex = "pod" -roots = [] file-types = ["pod"] [[grammar]] @@ -1274,7 +1233,6 @@ source = { git = "https://github.com/tree-sitter-perl/tree-sitter-pod", rev = "d [[language]] name = "racket" scope = "source.racket" -roots = [] file-types = ["rkt", "rktd", "rktl", "scrbl"] shebangs = ["racket"] comment-token = ";" @@ -1285,7 +1243,6 @@ grammar = "scheme" [[language]] name = "common-lisp" scope = "source.lisp" -roots = [] file-types = ["lisp", "asd", "cl", "l", "lsp", "ny", "podsl", "sexp"] shebangs = ["lisp", "sbcl", "ccl", "clisp", "ecl"] comment-token = ";" @@ -1302,7 +1259,6 @@ grammar = "scheme" [[language]] name = "comment" scope = "scope.comment" -roots = [] file-types = [] injection-regex = "comment" @@ -1314,7 +1270,6 @@ source = { git = "https://github.com/stsewd/tree-sitter-comment", rev = "5dd3c62 name = "wgsl" scope = "source.wgsl" file-types = ["wgsl"] -roots = [] comment-token = "//" language-servers = [ "wgsl_analyzer" ] indent = { tab-width = 4, unit = " " } @@ -1326,7 +1281,6 @@ source = { git = "https://github.com/szebniok/tree-sitter-wgsl", rev = "272e89ef [[language]] name = "llvm" scope = "source.llvm" -roots = [] file-types = ["ll"] comment-token = ";" indent = { tab-width = 2, unit = " " } @@ -1339,7 +1293,6 @@ source = { git = "https://github.com/benwilliamgraham/tree-sitter-llvm", rev = " [[language]] name = "llvm-mir" scope = "source.llvm_mir" -roots = [] file-types = [] comment-token = ";" indent = { tab-width = 2, unit = " " } @@ -1355,7 +1308,6 @@ name = "llvm-mir-yaml" # # grammar = "yaml" scope = "source.yaml" -roots = [] file-types = ["mir"] comment-token = "#" indent = { tab-width = 2, unit = " " } @@ -1363,7 +1315,6 @@ indent = { tab-width = 2, unit = " " } [[language]] name = "tablegen" scope = "source.tablegen" -roots = [] file-types = ["td"] comment-token = "//" indent = { tab-width = 2, unit = " " } @@ -1391,7 +1342,6 @@ name = "markdown.inline" scope = "source.markdown.inline" injection-regex = "markdown\\.inline" file-types = [] -roots = [] grammar = "markdown_inline" [[grammar]] @@ -1442,7 +1392,6 @@ source = { git = "https://github.com/camdencheek/tree-sitter-dockerfile", rev = [[language]] name = "git-commit" scope = "git.commitmsg" -roots = [] file-types = ["COMMIT_EDITMSG"] comment-token = "#" indent = { tab-width = 2, unit = " " } @@ -1456,7 +1405,6 @@ source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev [[language]] name = "diff" scope = "source.diff" -roots = [] file-types = ["diff", "patch", "rej"] injection-regex = "diff" comment-token = "#" @@ -1469,7 +1417,6 @@ source = { git = "https://github.com/the-mikedavis/tree-sitter-diff", rev = "fd7 [[language]] name = "git-rebase" scope = "source.gitrebase" -roots = [] file-types = ["git-rebase-todo"] injection-regex = "git-rebase" comment-token = "#" @@ -1484,7 +1431,6 @@ name = "regex" scope = "source.regex" injection-regex = "regex" file-types = ["regex", ".Rbuildignore"] -roots = [] [[grammar]] name = "regex" @@ -1493,7 +1439,6 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-regex", rev = "e1cf [[language]] name = "git-config" scope = "source.gitconfig" -roots = [] file-types = [".gitmodules", ".gitconfig", { suffix = ".git/config" }, { suffix = ".config/git/config" }] injection-regex = "git-config" comment-token = "#" @@ -1506,7 +1451,6 @@ source = { git = "https://github.com/the-mikedavis/tree-sitter-git-config", rev [[language]] name = "git-attributes" scope = "source.gitattributes" -roots = [] file-types = [".gitattributes"] injection-regex = "git-attributes" comment-token = "#" @@ -1519,7 +1463,6 @@ source = { git = "https://github.com/mtoohey31/tree-sitter-gitattributes", rev = [[language]] name = "git-ignore" scope = "source.gitignore" -roots = [] file-types = [".gitignore", ".gitignore_global", ".ignore", ".prettierignore", ".eslintignore", ".npmignore", "CODEOWNERS"] injection-regex = "git-ignore" comment-token = "#" @@ -1534,7 +1477,6 @@ name = "graphql" scope = "source.graphql" injection-regex = "graphql" file-types = ["gql", "graphql", "graphqls"] -roots = [] language-servers = [ "graphql-language-service" ] indent = { tab-width = 2, unit = " " } @@ -1562,7 +1504,6 @@ name = "iex" scope = "source.iex" injection-regex = "iex" file-types = ["iex"] -roots = [] [[grammar]] name = "iex" @@ -1625,7 +1566,6 @@ scope = "source.hcl" injection-regex = "(hcl|tf|nomad)" language-id = "terraform" file-types = ["hcl", "tf", "nomad"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } language-servers = [ "terraform-ls" ] @@ -1640,7 +1580,6 @@ name = "tfvars" scope = "source.tfvars" language-id = "terraform-vars" file-types = ["tfvars"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } language-servers = [ "terraform-ls" ] @@ -1652,7 +1591,6 @@ name = "org" scope = "source.org" injection-regex = "org" file-types = ["org"] -roots = [] indent = { tab-width = 2, unit = " " } [[grammar]] @@ -1664,7 +1602,6 @@ name = "solidity" scope = "source.sol" injection-regex = "(sol|solidity)" file-types = ["sol"] -roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } language-servers = [ "solc" ] @@ -1693,7 +1630,6 @@ name = "ron" scope = "source.ron" injection-regex = "ron" file-types = ["ron"] -roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } @@ -1707,7 +1643,6 @@ scope = "source.robot" injection-regex = "robot" file-types = ["robot", "resource"] comment-token = "#" -roots = [] indent = { tab-width = 4, unit = " " } language-servers = [ "robotframework_ls" ] @@ -1721,7 +1656,6 @@ scope = "source.r" injection-regex = "(r|R)" file-types = ["r", "R", ".Rprofile", "Rprofile.site", ".RHistory"] shebangs = ["r", "R"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } language-servers = [ "r" ] @@ -1735,7 +1669,6 @@ name = "rmarkdown" scope = "source.rmd" injection-regex = "(r|R)md" file-types = ["rmd", "Rmd"] -roots = [] indent = { tab-width = 2, unit = " " } grammar = "markdown" language-servers = [ "r" ] @@ -1759,7 +1692,6 @@ name = "erb" scope = "text.html.erb" injection-regex = "erb" file-types = ["erb"] -roots = [] indent = { tab-width = 2, unit = " " } grammar = "embedded-template" @@ -1768,7 +1700,6 @@ name = "ejs" scope = "text.html.ejs" injection-regex = "ejs" file-types = ["ejs"] -roots = [] indent = { tab-width = 2, unit = " " } grammar = "embedded-template" @@ -1805,7 +1736,6 @@ source = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = " name = "sql" scope = "source.sql" file-types = ["sql", "dsql"] -roots = [] comment-token = "--" indent = { tab-width = 4, unit = " " } injection-regex = "sql" @@ -1851,7 +1781,6 @@ scope = "source.nu" injection-regex = "nu" file-types = ["nu"] shebangs = ["nu"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } @@ -1864,7 +1793,6 @@ name = "vala" scope = "source.vala" injection-regex = "vala" file-types = ["vala", "vapi"] -roots = [] comment-token = "//" indent = { tab-width = 2, unit = " " } language-servers = [ "vala-language-server" ] @@ -1878,7 +1806,6 @@ name = "hare" scope = "source.hare" injection-regex = "hare" file-types = ["ha"] -roots = [] comment-token = "//" indent = { tab-width = 8, unit = "\t" } @@ -1891,7 +1818,6 @@ name = "devicetree" scope = "source.devicetree" injection-regex = "(dtsi?|devicetree|fdt)" file-types = ["dts", "dtsi"] -roots = [] comment-token = "//" indent = { tab-width = 4, unit = "\t" } @@ -1904,7 +1830,6 @@ name = "cairo" scope = "source.cairo" injection-regex = "cairo" file-types = ["cairo"] -roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } # auto-format = true @@ -1916,7 +1841,6 @@ name = "cpon" scope = "scope.cpon" injection-regex = "cpon" file-types = ["cpon", "cp"] -roots = [] auto-format = true comment-token = "//" indent = { tab-width = 2, unit = " " } @@ -1944,7 +1868,6 @@ name = "meson" scope = "source.meson" injection-regex = "meson" file-types = ["meson.build", "meson_options.txt"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } @@ -1956,7 +1879,6 @@ source = { git = "https://github.com/staysail/tree-sitter-meson", rev = "32a83e8 name = "sshclientconfig" scope = "source.sshclientconfig" file-types = [{ suffix = ".ssh/config" }, { suffix = "/etc/ssh/ssh_config" }] -roots = [] comment-token = "#" [[grammar]] @@ -1969,7 +1891,6 @@ scope = "source.scheme" injection-regex = "scheme" file-types = ["ss", "scm"] shebangs = ["scheme", "guile", "chicken"] -roots = [] comment-token = ";" indent = { tab-width = 2, unit = " " } @@ -1996,7 +1917,6 @@ source = {git = "https://github.com/v-analyzer/v-analyzer", subpath = "tree_sitt name = "verilog" scope = "source.verilog" file-types = ["v", "vh", "sv", "svh"] -roots = [] comment-token = "//" language-servers = [ "svlangserver" ] indent = { tab-width = 2, unit = " " } @@ -2011,7 +1931,6 @@ name = "edoc" scope = "source.edoc" file-types = ["edoc", "edoc.in"] injection-regex = "edoc" -roots = [] indent = { tab-width = 4, unit = " " } [[grammar]] @@ -2023,7 +1942,6 @@ name = "jsdoc" scope = "source.jsdoc" injection-regex = "jsdoc" file-types = ["jsdoc"] -roots = [] indent = { tab-width = 2, unit = " " } [[grammar]] @@ -2035,7 +1953,6 @@ name = "openscad" scope = "source.openscad" injection-regex = "openscad" file-types = ["scad"] -roots = [] comment-token = "//" language-servers = [ "openscad-lsp" ] indent = { tab-width = 2, unit = "\t" } @@ -2077,7 +1994,6 @@ name = "starlark" scope = "source.starlark" injection-regex = "(starlark|bzl|bazel)" file-types = ["bzl", "bazel", "BUILD", "star"] -roots = [] comment-token = "#" indent = { tab-width = 4, unit = " " } grammar = "python" @@ -2086,7 +2002,6 @@ grammar = "python" name = "elvish" scope = "source.elvish" file-types = ["elv"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } language-servers = [ "elvish" ] @@ -2102,7 +2017,6 @@ scope = "source.idr" injection-regex = "idr" file-types = ["idr"] shebangs = [] -roots = [] comment-token = "--" indent = { tab-width = 2, unit = " " } language-servers = [ "idris2-lsp" ] @@ -2126,7 +2040,6 @@ name = "ungrammar" scope = "source.ungrammar" injection-regex = "ungrammar" file-types = ["ungram", "ungrammar"] -roots = [] comment-token = "//" indent = { tab-width = 2, unit = " " } @@ -2139,7 +2052,6 @@ name = "dot" scope = "source.dot" injection-regex = "dot" file-types = ["dot"] -roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } language-servers = [ "dot-language-server" ] @@ -2169,7 +2081,6 @@ name = "slint" scope = "source.slint" injection-regex = "slint" file-types = ["slint"] -roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } language-servers = [ "slint-lsp" ] @@ -2183,7 +2094,6 @@ name = "task" scope = "source.task" injection-regex = "task" file-types = ["task"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } @@ -2196,7 +2106,6 @@ name = "xit" scope = "source.xit" injection-regex = "xit" file-types = ["xit"] -roots = [] indent = { tab-width = 4, unit = " " } [[grammar]] @@ -2221,7 +2130,6 @@ name = "pascal" scope = "source.pascal" injection-regex = "pascal" file-types = ["pas", "pp", "inc", "lpr", "lfm"] -roots = [] comment-token = "//" indent = { tab-width = 2, unit = " " } language-servers = [ "pasls" ] @@ -2236,7 +2144,6 @@ scope = "source.sml" injection-regex = "sml" file-types = ["sml"] comment-token = "(*" -roots = [] [[grammar]] name = "sml" @@ -2260,7 +2167,6 @@ name = "astro" scope = "source.astro" injection-regex = "astro" file-types = ["astro"] -roots = [] indent = { tab-width = 2, unit = " " } [[grammar]] @@ -2272,7 +2178,6 @@ name = "bass" scope = "source.bass" injection-regex = "bass" file-types = ["bass"] -roots = [] comment-token = ";" indent = { tab-width = 2, unit = " " } language-servers = [ "bass" ] @@ -2286,7 +2191,6 @@ name = "wat" scope = "source.wat" comment-token = ";;" file-types = ["wat"] -roots = [] [[grammar]] name = "wat" @@ -2297,7 +2201,6 @@ name = "wast" scope = "source.wast" comment-token = ";;" file-types = ["wast"] -roots = [] [[grammar]] name = "wast" @@ -2307,7 +2210,6 @@ source = { git = "https://github.com/wasm-lsp/tree-sitter-wasm", rev = "2ca28a9f name = "d" scope = "source.d" file-types = [ "d", "dd" ] -roots = [] comment-token = "//" injection-regex = "d" indent = { tab-width = 4, unit = " "} @@ -2322,7 +2224,6 @@ source = { git = "https://github.com/gdamore/tree-sitter-d", rev="601c4a1e8310fb name = "vhs" scope = "source.vhs" file-types = ["tape"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } grammar = "vhs" @@ -2335,7 +2236,6 @@ source = { git = "https://github.com/charmbracelet/tree-sitter-vhs", rev = "c6d8 name = "kdl" scope = "source.kdl" file-types = ["kdl"] -roots = [] comment-token = "//" injection-regex = "kdl" @@ -2404,7 +2304,6 @@ file-types = [ "xoml" ] indent = { tab-width = 2, unit = " " } -roots = [] [language.auto-pairs] '(' = ')' @@ -2425,7 +2324,6 @@ scope = "source.dtd" injection-regex = "dtd" file-types = ["dtd", "ent"] indent = {tab-width = 2, unit = " "} -roots = [] [language.auto-pairs] '(' = ')' @@ -2443,7 +2341,6 @@ name = "wit" scope = "source.wit" injection-regex = "wit" file-types = ["wit"] -roots = [] comment-token = "//" indent = { tab-width = 2, unit = " " } @@ -2466,7 +2363,6 @@ file-types = [".env", ".env.local", ".env.development", ".env.production", ".env injection-regex = "env" comment-token = "#" indent = { tab-width = 4, unit = "\t" } -roots = [] grammar = "bash" [[language]] @@ -2499,7 +2395,6 @@ file-types = [ injection-regex = "ini" comment-token = "#" indent = { tab-width = 4, unit = "\t" } -roots = [] [[grammar]] name = "ini" @@ -2509,7 +2404,6 @@ source = { git = "https://github.com/justinmk/tree-sitter-ini", rev = "4d247fb87 name = "bicep" scope = "source.bicep" file-types = ["bicep"] -roots = [] auto-format = true comment-token = "//" indent = { tab-width = 2, unit = " "} @@ -2523,7 +2417,6 @@ source = { git = "https://github.com/the-mikedavis/tree-sitter-bicep", rev = "d8 name = "qml" scope = "source.qml" file-types = ["qml"] -roots = [] language-servers = [ "qmlls" ] indent = { tab-width = 4, unit = " " } grammar = "qmljs" @@ -2537,7 +2430,6 @@ name = "mermaid" scope = "source.mermaid" injection-regex = "mermaid" file-types = ["mermaid"] -roots = [] comment-token = "%%" indent = { tab-width = 4, unit = " " } @@ -2551,7 +2443,6 @@ scope = "source.m" file-types = ["m"] comment-token = "%" shebangs = ["octave-cli", "matlab"] -roots = [] indent = { tab-width = 2, unit = " " } [[grammar]] @@ -2576,7 +2467,6 @@ name = "dhall" scope = "source.dhall" injection-regex = "dhall" file-types = ["dhall"] -roots = [] comment-token = "--" indent = { tab-width = 2, unit = " " } language-servers = [ "dhall-lsp-server" ] @@ -2591,7 +2481,6 @@ name = "sage" scope = "source.sage" file-types = ["sage"] injection-regex = "sage" -roots = [] comment-token = "#" indent = { tab-width = 4, unit = " " } grammar = "python" @@ -2602,7 +2491,6 @@ scope = "source.msbuild" injection-regex = "msbuild" file-types = ["proj", "vbproj", "csproj", "fsproj", "targets", "props"] indent = { tab-width = 2, unit = " " } -roots = [] grammar = "xml" [language.auto-pairs] @@ -2618,7 +2506,6 @@ name = "pem" scope = "source.pem" file-types = ["pem", "cert", "crt"] injection-regex = "pem" -roots = [] grammar = "pem" [[grammar]] @@ -2629,7 +2516,6 @@ source = { git = "https://github.com/mtoohey31/tree-sitter-pem", rev = "be67a433 name = "passwd" scope = "source.passwd" file-types = ["passwd"] -roots = [] [[grammar]] name = "passwd" @@ -2639,7 +2525,6 @@ source = { git = "https://github.com/ath3/tree-sitter-passwd", rev = "20239395ea name = "hosts" scope = "source.hosts" file-types = ["hosts"] -roots = [] comment-token = "#" [[grammar]] @@ -2651,7 +2536,6 @@ name = "uxntal" scope = "source.tal" injection-regex = "tal" file-types = ["tal"] -roots = [] auto-format = false comment-token = "(" @@ -2664,7 +2548,6 @@ name = "yuck" scope = "source.yuck" injection-regex = "yuck" file-types = ["yuck"] -roots = [] comment-token = ";" indent = { tab-width = 2, unit = " " } @@ -2677,7 +2560,6 @@ name = "prql" scope = "source.prql" injection-regex = "prql" file-types = ["prql"] -roots = [] comment-token = "#" indent = { tab-width = 4, unit = " " } @@ -2689,7 +2571,6 @@ source = { git = "https://github.com/PRQL/tree-sitter-prql", rev = "09e158cd3650 name = "po" scope = "source.po" file-types = ["po", "pot"] -roots = [] comment-token = "#" [[grammar]] @@ -2701,7 +2582,6 @@ name = "nasm" scope = "source.nasm" file-types = ["asm", "S", "nasm"] injection-regex = "n?asm" -roots = [] comment-token = ";" indent = { tab-width = 8, unit = " " } @@ -2714,7 +2594,6 @@ name = "gas" scope = "source.gas" file-types = ["s"] injection-regex = "gas" -roots = [] comment-token = "#" indent = { tab-width = 8, unit = " " } @@ -2727,7 +2606,6 @@ name = "rst" scope = "source.rst" comment-token = ".." file-types = ["rst"] -roots = [] [[grammar]] name = "rst" @@ -2738,7 +2616,6 @@ name = "capnp" scope = "source.capnp" injection-regex = "capnp" file-types = ["capnp"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } @@ -2764,7 +2641,6 @@ source = { git = "https://github.com/indoorvivants/tree-sitter-smithy", rev = "c name = "vhdl" scope = "source.vhdl" file-types = ["vhd", "vhdl"] -roots = [] comment-token = "--" language-servers = [ "vhdl_ls" ] indent = { tab-width = 2, unit = " " } @@ -2776,7 +2652,6 @@ source = { git = "https://github.com/teburd/tree-sitter-vhdl", rev = "c57313adee [[language]] name = "rego" -roots = [] scope = "source.rego" injection-regex = "rego" file-types = ["rego"] @@ -2795,7 +2670,6 @@ scope = "source.nim" injection-regex = "nim" file-types = ["nim", "nims", "nimble"] shebangs = [] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } language-servers = [ "nimlangserver" ] @@ -2825,7 +2699,6 @@ name = "hurl" scope = "source.hurl" injection-regex = "hurl" file-types = ["hurl"] -roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } @@ -2836,7 +2709,6 @@ source = { git = "https://github.com/pfeiferj/tree-sitter-hurl", rev = "264c4206 [[language]] name = "markdoc" scope = "text.markdoc" -roots = [] file-types = ["mdoc"] language-servers = [ "markdoc-ls" ] @@ -2849,7 +2721,6 @@ name = "opencl" scope = "source.cl" injection-regex = "(cl|opencl)" file-types = ["cl"] -roots = [] comment-token = "//" language-servers = [ "clangd" ] @@ -2862,7 +2733,6 @@ name = "just" scope = "source.just" file-types = ["justfile", "Justfile", ".justfile", ".Justfile"] injection-regex = "just" -roots = [] comment-token = "#" indent = { tab-width = 4, unit = "\t" } @@ -2875,7 +2745,6 @@ name = "blueprint" scope = "source.blueprint" injection-regex = "blueprint" file-types = ["blp"] -roots = [] comment-token = "//" language-servers = [ "blueprint-compiler" ] indent = { tab-width = 4, unit = " " } @@ -2889,7 +2758,6 @@ name = "forth" scope = "source.forth" injection-regex = "forth" file-types = ["fs", "forth", "fth", "4th"] -roots = [] comment-token = "\\" language-servers = [ "forth-lsp" ] indent = { tab-width = 3, unit = " " } @@ -2918,7 +2786,6 @@ name = "t32" scope = "source.t32" injection-regex = "t32" file-types = ["cmm", "t32"] -roots = [] comment-token = ";" indent = { tab-width = 2, unit = " " } @@ -2931,7 +2798,6 @@ name = "webc" scope = "text.html.webc" injection-regex = "webc" file-types = ["webc"] -roots = [] indent = { tab-width = 2, unit = " " } grammar = "html" @@ -2940,7 +2806,6 @@ name = "typst" scope = "source.typst" injection-regex = "typst" file-types = ["typst", "typ"] -roots = [] comment-token = "//" language-servers = ["typst-lsp"] indent = { tab-width = 2, unit = " " } @@ -2961,7 +2826,6 @@ name = "nunjucks" scope = "text.html.nunjucks" injection-regex = "nunjucks" file-types = ["njk"] -roots = [] indent = { tab-width = 2, unit = " " } grammar = "jinja2" @@ -2970,7 +2834,6 @@ name = "jinja" scope = "text.html.jinja" injection-regex = "jinja" file-types = ["jinja", "jinja2", "j2"] -roots = [] indent = { tab-width = 2, unit = " " } grammar = "jinja2" @@ -2987,7 +2850,6 @@ name = "wren" scope = "source.wren" injection-regex = "wren" file-types = ["wren"] -roots = [] indent = { tab-width = 2, unit = " "} [[language]] @@ -2996,7 +2858,6 @@ scope = "source.unison" injection-regex = "unison" file-types = ["u"] shebangs = [] -roots = [] auto-format = false comment-token = "--" indent = { tab-width = 4, unit = " " } @@ -3016,7 +2877,6 @@ source = { git = "https://github.com/kylegoetz/tree-sitter-unison", rev = "98c4e name = "todotxt" scope = "text.todotxt" file-types = [{ suffix = ".todo.txt" }, "todotxt"] -roots = [] formatter = { command = "sort" } auto-format = true @@ -3028,7 +2888,6 @@ source = { git = "https://github.com/arnarg/tree-sitter-todotxt", rev = "0207f6a name = "strace" scope = "source.strace" file-types = ["strace"] -roots = [] [[grammar]] name = "strace" @@ -3038,7 +2897,6 @@ source = { git = "https://github.com/sigmaSd/tree-sitter-strace", rev = "2b18fdf name = "gemini" scope = "source.gmi" file-types = ["gmi"] -roots = [] [[grammar]] name = "gemini" From e5d02cd4bd19c9db7825c969d3c2660e3bee93c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:15:37 +0900 Subject: [PATCH 085/393] build(deps): bump serde from 1.0.191 to 1.0.192 (#8810) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d8c7166d..d44f952cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1869,18 +1869,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.191" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a834c4821019838224821468552240d4d95d14e751986442c816572d39a080c9" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.191" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fa52d5646bce91b680189fe5b1c049d2ea38dabb4e2e7c8d00ca12cfbfbcfd" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", From 40959bb449ec9dfbff9249332853a02b50f483fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:15:50 +0900 Subject: [PATCH 086/393] build(deps): bump cc from 1.0.83 to 1.0.84 (#8809) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d44f952cf..1e85dd86b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,9 +160,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856" dependencies = [ "libc", ] From 2040444da9eb3a9b2438bf98c0568ce06ec4c1e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:21:00 +0100 Subject: [PATCH 087/393] build(deps): bump rustix from 0.38.21 to 0.38.22 (#8807) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1e85dd86b..f7361d0ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1458,9 +1458,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" @@ -1829,9 +1829,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "80109a168d9bc0c7f483083244543a6eb0dba02295d33ca268145e6190d6df0c" dependencies = [ "bitflags 2.4.1", "errno", From 3c8bf9df4adc88b3e81b2955813098b873dde44a Mon Sep 17 00:00:00 2001 From: Eemil Haapanen <70660230+eemilhaa@users.noreply.github.com> Date: Fri, 17 Nov 2023 02:34:56 +0200 Subject: [PATCH 088/393] theme: add starlight (#8787) --- runtime/themes/starlight.toml | 113 ++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 runtime/themes/starlight.toml diff --git a/runtime/themes/starlight.toml b/runtime/themes/starlight.toml new file mode 100644 index 000000000..09db90fd6 --- /dev/null +++ b/runtime/themes/starlight.toml @@ -0,0 +1,113 @@ +# Author : eemilhaa +# Palette from : https://github.com/CosmicToast/starlight + +# Syntax +"function" = "green" +"constructor" = "green" + +"type" = "cyan" +"string.special" = "cyan" +"string.regexp" = "cyan" +"constant" = "cyan" +"punctuation.special" = "cyan" + +"namespace" = "white" +"module" = "white" +"variable" = "white" + +"attribute" = "magenta" +"variable.parameter" = "magenta" +"variable.other.member" = "magenta" +"type.parameter" = "magenta" + +"keyword" = "blue" +"variable.builtin" = "blue" +"label" = "blue" +"tag" = "blue" +"operator" = "blue" +"special" = "blue" + +"string" = "yellow" + +"punctuation" = "punct" + +"comment" = "dark-fg" + +# Markup +"markup.heading.marker" = { fg = "blue", modifiers = ["bold"] } +"markup.heading" = { fg = "white", modifiers = ["bold"] } +"markup.list" = "blue" +"markup.bold" = { fg = "magenta", modifiers = ["bold"] } +"markup.italic" = { fg = "magenta", modifiers = ["italic"] } +"markup.strikethrough" = "red" +"markup.link" = "cyan" +"markup.link.text" = "yellow" +"markup.quote" = "magenta" +"markup.raw" = "green" + +# UI +"diff.plus" = "green" +"diff.minus" = "red" +"diff.delta" = "blue" + +"ui.background" = { fg = "dark-fg", bg = "dark-bg" } +"ui.cursor" = { fg = "black", bg = "light-fg" } +"ui.cursor.primary" = { fg = "black", bg = "yellow" } +"ui.cursor.match" = { fg = "black", bg = "dark-blue", modifiers = ["bold"] } +"ui.linenr" = "dark-fg" +"ui.linenr.selected" = "yellow" +"ui.statusline" = { fg = "light-fg", bg = "light-bg" } +"ui.statusline.inactive" = { fg = "dark-fg", bg = "light-bg" } +"ui.statusline.insert" = { fg = "black", bg = "green" } +"ui.statusline.select" = { fg = "black", bg = "magenta" } +"ui.statusline.normal" = { fg = "black", bg = "blue" } +"ui.popup" = { fg = "dark-fg", bg = "light-bg" } +"ui.window" = { fg = "light-bg", bg = "dark-bg" } +"ui.help" = { fg = "light-fg", bg = "light-bg" } +"ui.text" = "light-fg" +"ui.text.focus" = { fg = "white", bg = "light-bg", modifiers = ["bold"] } +"ui.virtual" = "dark-fg" +"ui.virtual.ruler" = { bg = "medium-bg" } +"ui.virtual.indent-guide" = "indent" +"ui.virtual.whitespace" = "indent" +"ui.menu" = { fg = "light-fg", bg = "light-bg" } +"ui.menu.selected" = { fg = "white", bg = "dark-fg", modifiers = ["bold"] } +"ui.selection" = { fg = "light-fg", bg = "dark-fg" } +"ui.selection.primary" = { fg = "white", bg = "dark-blue" } +"ui.highlight" = { bg = "light-bg" } +"ui.cursorline.primary" = { bg = "black" } +"ui.cursorcolumn.primary" = { bg = "black" } +"ui.bufferline.background" = { bg = "dark-bg" } +"ui.bufferline" = { fg = "light-fg", bg = "light-bg" } +"ui.bufferline.active" = { fg = "white", bg = "dark-fg" } + +"diagnostic.error" = { underline = { color = "red", style = "curl" } } +"diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } +"diagnostic.info" = { underline = { color = "blue", style = "curl" } } +"diagnostic.hint" = { underline = { color = "blue", style = "curl" } } + +"info" = "blue" +"hint" = "blue" +"warning" = "yellow" +"error" = "red" + +[palette] +# Colors +red = "#FF4D51" +green = "#35D450" +yellow = "#E9E836" +blue = "#5DC5F8" +dark-blue = "#24ACD4" +magenta = "#FEABF2" +cyan = "#24DFC4" +white = "#ffffff" +punct = "#C9C9C9" + +# Grays +black = "#1e1e1e" +dark-bg = "#242424" +medium-bg = "#2D2D2D" +light-bg = "#353535" +indent = "#616161" +dark-fg = "#929292" +light-fg = "#E6E6E6" From 73ca2d5f84c5728712c00135ff82a42ae3487b8c Mon Sep 17 00:00:00 2001 From: Seth Maurice-Brant <37915796+iSaluki@users.noreply.github.com> Date: Fri, 17 Nov 2023 21:54:30 +0000 Subject: [PATCH 089/393] Change Fedora installation to the new official Helix package (#8762) Remove COPR install in favour of official Helix package --- book/src/install.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/book/src/install.md b/book/src/install.md index dc028625b..897985013 100644 --- a/book/src/install.md +++ b/book/src/install.md @@ -65,10 +65,7 @@ sudo apt install helix ### Fedora/RHEL -Enable the `COPR` repository for Helix: - ```sh -sudo dnf copr enable varlad/helix sudo dnf install helix ``` From 5889b81fc7a7da25352f47240aa6d665ce6b8773 Mon Sep 17 00:00:00 2001 From: Luca Saccarola <96259932+saccarosium@users.noreply.github.com> Date: Fri, 17 Nov 2023 22:57:15 +0100 Subject: [PATCH 090/393] docs: add docs for soft-wrap in languages.toml (#8836) --- book/src/languages.md | 1 + 1 file changed, 1 insertion(+) diff --git a/book/src/languages.md b/book/src/languages.md index 778489f8d..632a9146c 100644 --- a/book/src/languages.md +++ b/book/src/languages.md @@ -66,6 +66,7 @@ These configuration keys are available: | `language-servers` | The Language Servers used for this language. See below for more information in the section [Configuring Language Servers for a language](#configuring-language-servers-for-a-language) | | `grammar` | The tree-sitter grammar to use (defaults to the value of `name`) | | `formatter` | The formatter for the language, it will take precedence over the lsp when defined. The formatter must be able to take the original file as input from stdin and write the formatted file to stdout | +| `soft-wrap` | [editor.softwrap](./configuration.md#editorsoft-wrap-section) | `text-width` | Maximum line length. Used for the `:reflow` command and soft-wrapping if `soft-wrap.wrap-at-text-width` is set, defaults to `editor.text-width` | | `workspace-lsp-roots` | Directories relative to the workspace root that are treated as LSP roots. Should only be set in `.helix/config.toml`. Overwrites the setting of the same name in `config.toml` if set. | From 7868136a18aefc2c611d667b344dacacb4b9e8e1 Mon Sep 17 00:00:00 2001 From: crozbo <35157367+crozbo@users.noreply.github.com> Date: Sat, 18 Nov 2023 00:32:06 +0100 Subject: [PATCH 091/393] Theme: Papercolor: Add inlay-hint style (#8827) --- runtime/themes/papercolor-light.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/themes/papercolor-light.toml b/runtime/themes/papercolor-light.toml index 5c59d6f51..279fa2429 100644 --- a/runtime/themes/papercolor-light.toml +++ b/runtime/themes/papercolor-light.toml @@ -26,6 +26,9 @@ "ui.virtual.whitespace" = { fg = "regular5" } "ui.virtual.indent-guide" = { fg = "bright0" } "ui.virtual.ruler" = { bg = "cursorline_secondary_bg", fg = "regular4" } +"ui.virtual.inlay-hint" = { fg = "regular5", modifiers = ["italic"] } +"ui.virtual.inlay-hint.parameter" = { fg = "regular5", modifiers = ["italic"] } +"ui.virtual.inlay-hint.type" = { fg = "regular5", modifiers = ["bold", "italic"] } "ui.cursor.match" = { bg = "matchparen_bg", fg = "matchparen_fg" } "ui.cursor" = { bg = "regular5", fg = "background" } "ui.cursor.primary" = { bg = "foreground", fg = "background" } From 2579bca21c250050e59ef782380ca3f3ed44fbb0 Mon Sep 17 00:00:00 2001 From: WuerfelDev Date: Fri, 17 Nov 2023 23:34:17 +0000 Subject: [PATCH 092/393] Book: fix formatting of some default values (#8837) --- book/src/configuration.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/book/src/configuration.md b/book/src/configuration.md index f8796245f..f067038a5 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -166,14 +166,14 @@ All git related options are only enabled in a git repository. | Key | Description | Default | |--|--|---------| -|`hidden` | Enables ignoring hidden files | true -|`follow-symlinks` | Follow symlinks instead of ignoring them | true -|`deduplicate-links` | Ignore symlinks that point at files already shown in the picker | true -|`parents` | Enables reading ignore files from parent directories | true -|`ignore` | Enables reading `.ignore` files | true -|`git-ignore` | Enables reading `.gitignore` files | true -|`git-global` | Enables reading global `.gitignore`, whose path is specified in git's config: `core.excludefile` option | true -|`git-exclude` | Enables reading `.git/info/exclude` files | true +|`hidden` | Enables ignoring hidden files | `true` +|`follow-symlinks` | Follow symlinks instead of ignoring them | `true` +|`deduplicate-links` | Ignore symlinks that point at files already shown in the picker | `true` +|`parents` | Enables reading ignore files from parent directories | `true` +|`ignore` | Enables reading `.ignore` files | `true` +|`git-ignore` | Enables reading `.gitignore` files | `true` +|`git-global` | Enables reading global `.gitignore`, whose path is specified in git's config: `core.excludefile` option | `true` +|`git-exclude` | Enables reading `.git/info/exclude` files | `true` |`max-depth` | Set with an integer value for maximum depth to recurse | Defaults to `None`. ### `[editor.auto-pairs]` Section From 39aa6fa646aeae08f4156558af199df1ecba4638 Mon Sep 17 00:00:00 2001 From: blinxen Date: Sat, 18 Nov 2023 02:24:59 +0100 Subject: [PATCH 093/393] Update some grammars to a commit where the license file is included (#8691) --- languages.toml | 24 ++++++------ runtime/queries/purescript/highlights.scm | 23 ++++++++++-- runtime/queries/sql/highlights.scm | 46 +++++++++++++++++++++-- 3 files changed, 73 insertions(+), 20 deletions(-) diff --git a/languages.toml b/languages.toml index 8761f90ad..3456209ae 100644 --- a/languages.toml +++ b/languages.toml @@ -95,7 +95,7 @@ command = "ansible-language-server" args = ["--stdio"] [language-server.lua-language-server] -command = "lua-language-server" +command = "lua-language-server" [language-server.lua-language-server.config.Lua.hint] enable = true @@ -975,7 +975,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "beancount" -source = { git = "https://github.com/polarmutex/tree-sitter-beancount", rev = "4cbd1f09cd07c1f1fabf867c2cf354f9da53cc4c" } +source = { git = "https://github.com/polarmutex/tree-sitter-beancount", rev = "f3741a3a68ade59ec894ed84a64673494d2ba8f3" } [[language]] name = "ocaml" @@ -1108,7 +1108,7 @@ formatter = { command = "purs-tidy", args = ["format"] } [[grammar]] name = "purescript" -source = { git = "https://github.com/postsolar/tree-sitter-purescript", rev = "593193b9bf0f46d5eee708a4e53044d2a9054897" } +source = { git = "https://github.com/postsolar/tree-sitter-purescript", rev = "5ef5592674ea42de75fc2792972e4ea0b6e3da6c" } [[language]] name = "zig" @@ -1218,7 +1218,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "perl" -source = { git = "https://github.com/tree-sitter-perl/tree-sitter-perl", rev = "9f3166800d40267fa68ed8273e96baf74f390517" } +source = { git = "https://github.com/tree-sitter-perl/tree-sitter-perl", rev = "e99bb5283805db4cb86c964722d709df21b0ac16" } [[language]] name = "pod" @@ -1264,7 +1264,7 @@ injection-regex = "comment" [[grammar]] name = "comment" -source = { git = "https://github.com/stsewd/tree-sitter-comment", rev = "5dd3c62f1bbe378b220fe16b317b85247898639e" } +source = { git = "https://github.com/stsewd/tree-sitter-comment", rev = "a37ca370310ac6f89b6e0ebf2b86b2219780494e" } [[language]] name = "wgsl" @@ -1288,7 +1288,7 @@ injection-regex = "llvm" [[grammar]] name = "llvm" -source = { git = "https://github.com/benwilliamgraham/tree-sitter-llvm", rev = "3b213925b9c4f42c1acfe2e10bfbb438d9c6834d" } +source = { git = "https://github.com/benwilliamgraham/tree-sitter-llvm", rev = "e9948edc41e9e5869af99dddb2b5ff5cc5581af6" } [[language]] name = "llvm-mir" @@ -1742,7 +1742,7 @@ injection-regex = "sql" [[grammar]] name = "sql" -source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "eeab7240a11098724e6f95bc57cc3ceaf5487d5f" } +source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "25be0b8f17e9189ad9e1b875869d025c5aec1286" } [[language]] name = "gdscript" @@ -2045,7 +2045,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "ungrammar" -source = { git = "https://github.com/Philipp-M/tree-sitter-ungrammar", rev = "0113de880a58ea14f2a75802e9b99fcc25003d9c" } +source = { git = "https://github.com/Philipp-M/tree-sitter-ungrammar", rev = "a7e104629cff5a8b7367187610631e8f5eb7c6ea" } [[language]] name = "dot" @@ -2171,7 +2171,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "astro" -source = { git = "https://github.com/virchau13/tree-sitter-astro", rev = "5f5c3e73c45967df9aa42f861fad2d77cd4e0900" } +source = { git = "https://github.com/virchau13/tree-sitter-astro", rev = "947e93089e60c66e681eba22283f4037841451e7" } [[language]] name = "bass" @@ -2541,7 +2541,7 @@ comment-token = "(" [[grammar]] name = "uxntal" -source = { git = "https://github.com/Jummit/tree-sitter-uxntal", rev = "9297e95ef74380b0ad84c4fd98f91e9f6e4319e6" } +source = { git = "https://github.com/Jummit/tree-sitter-uxntal", rev = "d68406066648cd6db4c6a2f11ec305af02079884" } [[language]] name = "yuck" @@ -2662,7 +2662,7 @@ grammar = "rego" [[grammar]] name = "rego" -source = { git = "https://github.com/FallenAngel97/tree-sitter-rego", rev = "b2667c975f07b33be3ceb83bea5cfbad88095866" } +source = { git = "https://github.com/FallenAngel97/tree-sitter-rego", rev = "9ac75e71b2d791e0aadeef68098319d86a2a14cf" } [[language]] name = "nim" @@ -2764,7 +2764,7 @@ indent = { tab-width = 3, unit = " " } [[grammar]] name = "forth" -source = { git = "https://github.com/alexanderbrevig/tree-sitter-forth", rev = "304ed77beb113e37af38b20ff14e3c37bf350d10" } +source = { git = "https://github.com/alexanderbrevig/tree-sitter-forth", rev = "90189238385cf636b9ee99ce548b9e5b5e569d48" } [[language]] name = "fsharp" diff --git a/runtime/queries/purescript/highlights.scm b/runtime/queries/purescript/highlights.scm index b110f3e01..b7868e6e7 100644 --- a/runtime/queries/purescript/highlights.scm +++ b/runtime/queries/purescript/highlights.scm @@ -1,3 +1,19 @@ +; ---------------------------------------------------------------------------- +; Record fields would need to come before literal strings in order to be captured correctly + + (record_accessor + field: [ (variable) + (string) + (triple_quote_string) + ] @variable.other.member) + + (exp_record_access + field: [ (variable) + (string) + (triple_quote_string) + ] @variable.other.member) + + ; ---------------------------------------------------------------------------- ; Literals and comments @@ -117,8 +133,7 @@ (row_field (field_name) @variable.other.member) (record_field (field_name) @variable.other.member) - (record_accessor (variable) @variable.other.member) - (exp_record_access (variable) @variable.other.member) + (record_field (field_pun) @variable.other.member) (signature name: (variable) @type) (function name: (variable) @function) @@ -126,8 +141,8 @@ (derive_declaration (instance_name) @function) ; true or false -((variable) @constant.builtin.boolean - (#match? @constant.builtin.boolean "^(true|false)$")) + ((variable) @constant.builtin.boolean + (#match? @constant.builtin.boolean "^(true|false)$")) ; The former one works for `tree-sitter highlight` but not in Helix/Kakoune. ; The latter two work in Helix (but not Kakoune) and are a good compromise between not highlighting anything at all diff --git a/runtime/queries/sql/highlights.scm b/runtime/queries/sql/highlights.scm index 1041cc2fc..09b07489e 100644 --- a/runtime/queries/sql/highlights.scm +++ b/runtime/queries/sql/highlights.scm @@ -131,6 +131,7 @@ (keyword_partition) (keyword_group) (keyword_with) + (keyword_without) (keyword_as) (keyword_having) (keyword_limit) @@ -227,6 +228,7 @@ (keyword_input) (keyword_name) (keyword_oid) + (keyword_oids) (keyword_options) (keyword_plpgsql) (keyword_precision) @@ -264,6 +266,44 @@ (keyword_user) (keyword_valid) (keyword_action) + (keyword_definer) + (keyword_invoker) + (keyword_security) + (keyword_extension) + (keyword_version) + (keyword_out) + (keyword_inout) + (keyword_variadic) + (keyword_session) + (keyword_isolation) + (keyword_level) + (keyword_serializable) + (keyword_repeatable) + (keyword_read) + (keyword_write) + (keyword_committed) + (keyword_uncommitted) + (keyword_deferrable) + (keyword_names) + (keyword_zone) + (keyword_immediate) + (keyword_deferred) + (keyword_constraints) + (keyword_snapshot) + (keyword_characteristics) + (keyword_off) + (keyword_follows) + (keyword_precedes) + (keyword_each) + (keyword_instead) + (keyword_of) + (keyword_initially) + (keyword_old) + (keyword_new) + (keyword_referencing) + (keyword_statement) + (keyword_execute) + (keyword_procedure) ] @keyword [ @@ -373,10 +413,8 @@ ">=" ">" "<>" - "->" - "->>" - "#>" - "#>>" + (op_other) + (op_unary_other) ] @operator [ From 2acf5e365e3a24ef244665435824ccb1abbef80a Mon Sep 17 00:00:00 2001 From: Niklas Alexander Shern <90867839+nshern@users.noreply.github.com> Date: Sat, 18 Nov 2023 02:44:01 +0100 Subject: [PATCH 094/393] theme: show active selection and buffer for naysayer theme (#8838) --- runtime/themes/naysayer.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/themes/naysayer.toml b/runtime/themes/naysayer.toml index 8922b3e22..41530d141 100644 --- a/runtime/themes/naysayer.toml +++ b/runtime/themes/naysayer.toml @@ -20,13 +20,13 @@ "ui.help" = { fg = "text", bg = "bg" } "ui.popup" = { fg = "text", bg = "bg" } "ui.menu" = { fg = "text", bg = "bg" } -"ui.menu.selected" = { fg = "text", bg = "bg" } +"ui.menu.selected" = { fg = "text", bg = "bg", modifiers = ['underlined'] } "ui.window" = { bg = "bg" } "diagnostic.error" = { bg = "error", fg = "text", modifiers = ["bold"] } "diagnostic.warning" = { bg = "warning", fg = "text", modifiers = ["bold"] } "diagnostic.hint" = { bg = "cyan", modifiers = ["bold"] } "ui.bufferline" = { fg = "text", bg = "bg" } -"ui.bufferline.active" = { fg = "text", bg = "bg" } +"ui.bufferline.active" = { fg = "text", bg = "bg", modifiers = ['underlined'] } "ui.gutter.selected" = { bg = "highlight-line", modifiers = ["bold"] } "ui.highlight" = { bg = "highlight-line" } From 34de1cab623c03b2ffdafb54714bc67cbabcf9e9 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Wed, 1 Nov 2023 08:14:17 -0700 Subject: [PATCH 095/393] make indent/unindent exit select mode --- helix-term/src/commands.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 648aa96e8..7f9e9d018 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4207,6 +4207,7 @@ fn indent(cx: &mut Context) { }), ); doc.apply(&transaction, view.id); + exit_select_mode(cx); } fn unindent(cx: &mut Context) { @@ -4246,6 +4247,7 @@ fn unindent(cx: &mut Context) { let transaction = Transaction::change(doc.text(), changes.into_iter()); doc.apply(&transaction, view.id); + exit_select_mode(cx); } fn format_selections(cx: &mut Context) { From 1271a50a82b596fda0fe33a9cdec7b0c3fb92654 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Sun, 5 Nov 2023 08:12:21 -0800 Subject: [PATCH 096/393] make paste commands exit select mode --- helix-term/src/commands.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 7f9e9d018..4e73568b1 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4085,22 +4085,27 @@ pub(crate) fn paste_bracketed_value(cx: &mut Context, contents: String) { }; let (view, doc) = current!(cx.editor); paste_impl(&[contents], doc, view, paste, count, cx.editor.mode); + exit_select_mode(cx); } fn paste_clipboard_after(cx: &mut Context) { paste(cx.editor, '+', Paste::After, cx.count()); + exit_select_mode(cx); } fn paste_clipboard_before(cx: &mut Context) { paste(cx.editor, '+', Paste::Before, cx.count()); + exit_select_mode(cx); } fn paste_primary_clipboard_after(cx: &mut Context) { paste(cx.editor, '*', Paste::After, cx.count()); + exit_select_mode(cx); } fn paste_primary_clipboard_before(cx: &mut Context) { paste(cx.editor, '*', Paste::Before, cx.count()); + exit_select_mode(cx); } fn replace_with_yanked(cx: &mut Context) { @@ -4160,6 +4165,7 @@ fn paste_after(cx: &mut Context) { Paste::After, cx.count(), ); + exit_select_mode(cx); } fn paste_before(cx: &mut Context) { @@ -4169,6 +4175,7 @@ fn paste_before(cx: &mut Context) { Paste::Before, cx.count(), ); + exit_select_mode(cx); } fn get_lines(doc: &Document, view_id: ViewId) -> Vec { From 5913073733b8724d97589ec9999252256708cf3c Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Sun, 5 Nov 2023 08:14:39 -0800 Subject: [PATCH 097/393] make replace with clipboard commands exit select mode --- helix-term/src/commands.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 4e73568b1..d300f848d 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4144,10 +4144,12 @@ fn replace_with_yanked_impl(editor: &mut Editor, register: char, count: usize) { fn replace_selections_with_clipboard(cx: &mut Context) { replace_with_yanked_impl(cx.editor, '+', cx.count()); + exit_select_mode(cx); } fn replace_selections_with_primary_clipboard(cx: &mut Context) { replace_with_yanked_impl(cx.editor, '*', cx.count()); + exit_select_mode(cx); } fn paste(editor: &mut Editor, register: char, pos: Paste, count: usize) { From d4a0eba1a7de3961a321e5220376c61634ec8cc4 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Sun, 5 Nov 2023 08:18:58 -0800 Subject: [PATCH 098/393] make align exit select mode --- helix-term/src/commands.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index d300f848d..e73fe2ed6 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -984,6 +984,7 @@ fn align_selections(cx: &mut Context) { let transaction = Transaction::change(doc.text(), changes.into_iter()); doc.apply(&transaction, view.id); + exit_select_mode(cx); } fn goto_window(cx: &mut Context, align: Align) { From 09c78e8b4e36cff0a4c00a0de3fc691dbf0e4873 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Sun, 5 Nov 2023 08:15:49 -0800 Subject: [PATCH 099/393] make switch case commands exit select mode --- helix-term/src/commands.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index e73fe2ed6..a783fc683 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1528,6 +1528,7 @@ where }); doc.apply(&transaction, view.id); + exit_select_mode(cx); } fn switch_case(cx: &mut Context) { From 6bf5548dbdfd1df6abe6323bd46b6e051168d94e Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Sun, 5 Nov 2023 08:07:22 -0800 Subject: [PATCH 100/393] make increment/decrement exit select mode --- helix-term/src/commands.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index a783fc683..f1d1df063 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -5684,6 +5684,7 @@ fn increment_impl(cx: &mut Context, increment_direction: IncrementDirection) { let transaction = Transaction::change(doc.text(), changes.into_iter()); let transaction = transaction.with_selection(new_selection); doc.apply(&transaction, view.id); + exit_select_mode(cx); } } From b306b25e82a33b4704846ab4fce9b10b2ee7f67c Mon Sep 17 00:00:00 2001 From: Dan Field Date: Sat, 18 Nov 2023 00:11:18 -0800 Subject: [PATCH 101/393] GN language support (#6969) Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 14 ++++++++++ runtime/queries/gn/highlights.scm | 42 ++++++++++++++++++++++++++++++ runtime/queries/gn/injections.scm | 15 +++++++++++ runtime/queries/gn/locals.scm | 16 ++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 runtime/queries/gn/highlights.scm create mode 100644 runtime/queries/gn/injections.scm create mode 100644 runtime/queries/gn/locals.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 9c55b4a05..a7d45a461 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -54,6 +54,7 @@ | git-rebase | ✓ | | | | | gleam | ✓ | ✓ | | `gleam` | | glsl | ✓ | ✓ | ✓ | | +| gn | ✓ | | | | | go | ✓ | ✓ | ✓ | `gopls`, `golangci-lint-langserver` | | godot-resource | ✓ | | | | | gomod | ✓ | | | `gopls` | diff --git a/languages.toml b/languages.toml index 3456209ae..3dedf6715 100644 --- a/languages.toml +++ b/languages.toml @@ -2740,6 +2740,20 @@ indent = { tab-width = 4, unit = "\t" } name = "just" source = { git = "https://github.com/IndianBoy42/tree-sitter-just", rev = "8af0aab79854aaf25b620a52c39485849922f766" } +[[language]] +name = "gn" +scope = "source.gn" +injection-regex = "gn" +file-types = ["gn", "gni"] +roots = [] +comment-token = "#" +indent = { tab-width = 2, unit = " " } +formatter = { command = "gn", args = ["format", "--stdin"] } + +[[grammar]] +name = "gn" +source = { git = "https://github.com/willcassella/tree-sitter-gn", rev = "e18d6e36a79b20dafb58f19d407bd38b0e60260e" } + [[language]] name = "blueprint" scope = "source.blueprint" diff --git a/runtime/queries/gn/highlights.scm b/runtime/queries/gn/highlights.scm new file mode 100644 index 000000000..ff619db11 --- /dev/null +++ b/runtime/queries/gn/highlights.scm @@ -0,0 +1,42 @@ +; Copyright (C) 2021 Will Cassella (github@willcassella.com) +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +(identifier) @variable.builtin + +(scope_access field: (_) @variable.other.member) + +(call target: (_) @function) + +[ "if" "else" ] @keyword.control.conditional + +[ + (assign_op) + (arithmetic_binary_op) + (comparison_binary_op) + (equivalence_binary_op) + (logical_and_binary_op) + (logical_or_binary_op) + (negation_unary_op) +] @operator + +[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket +[ "." "," ] @punctuation.delimiter + +(string) @string +(string_escape) @constant.character.escape +(string_expansion [ "$" "${" "}" ] @constant.character.escape) +[ (integer) (hex) ] @constant.numeric +(boolean) @constant.builtin.boolean + +(comment) @comment diff --git a/runtime/queries/gn/injections.scm b/runtime/queries/gn/injections.scm new file mode 100644 index 000000000..55864c293 --- /dev/null +++ b/runtime/queries/gn/injections.scm @@ -0,0 +1,15 @@ +; Copyright (C) 2021 Will Cassella (github@willcassella.com) +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +((comment) @injection.content (#set! injection.language "comment")) diff --git a/runtime/queries/gn/locals.scm b/runtime/queries/gn/locals.scm new file mode 100644 index 000000000..e8bd995c3 --- /dev/null +++ b/runtime/queries/gn/locals.scm @@ -0,0 +1,16 @@ +; Copyright (C) 2021 Will Cassella (github@willcassella.com) +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +(source_file) @local.scope +(assignment target: (identifier) @local.definition) From b16752306cf6799b30a5bd5cde743a8cf4c395f4 Mon Sep 17 00:00:00 2001 From: blinxen Date: Mon, 13 Nov 2023 22:10:09 +0100 Subject: [PATCH 102/393] [themes] Mention license files in README --- runtime/themes/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/themes/README.md b/runtime/themes/README.md index 1c9c5ae9b..302ba34cf 100644 --- a/runtime/themes/README.md +++ b/runtime/themes/README.md @@ -6,4 +6,12 @@ If you submit a theme, please include a comment at the top with your name and em # Author : Name ``` +If you are submitting a theme that is already published somewhere, then please +add the corresponding license file for it under `licenses/` with the following +name `theme_name.license` and add a comment at the top of the theme file: + +```toml +# License: +``` + We have a preview page for themes on our [wiki](https://github.com/helix-editor/helix/wiki/Themes)! From a0e5bb8520b4461417e171e4b8146f02d04ffdc1 Mon Sep 17 00:00:00 2001 From: blinxen Date: Sun, 19 Nov 2023 14:08:05 +0100 Subject: [PATCH 103/393] [themes] Add missing license files for recently added themes --- runtime/themes/licenses/poimandres.LICENSE | 21 +++++++++++++++++++ runtime/themes/licenses/starlight.LICENSE | 24 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 runtime/themes/licenses/poimandres.LICENSE create mode 100644 runtime/themes/licenses/starlight.LICENSE diff --git a/runtime/themes/licenses/poimandres.LICENSE b/runtime/themes/licenses/poimandres.LICENSE new file mode 100644 index 000000000..bc8d1cf48 --- /dev/null +++ b/runtime/themes/licenses/poimandres.LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 drcmda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/runtime/themes/licenses/starlight.LICENSE b/runtime/themes/licenses/starlight.LICENSE new file mode 100644 index 000000000..fdddb29aa --- /dev/null +++ b/runtime/themes/licenses/starlight.LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to From bfd60a5b39c468055f03a3339ac60546cceefc48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 09:31:12 +0900 Subject: [PATCH 104/393] build(deps): bump rustix from 0.38.22 to 0.38.25 (#8874) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7361d0ec..fda89964c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1829,9 +1829,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.22" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80109a168d9bc0c7f483083244543a6eb0dba02295d33ca268145e6190d6df0c" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ "bitflags 2.4.1", "errno", From 3052050ee0388207048318fed0909e63a2c865f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Tue, 21 Nov 2023 12:04:20 +0100 Subject: [PATCH 105/393] open urls with goto_file command (#5820) * feat(commands): open urls with goto_file command Add capability for `goto_file` command to open an URL under cursor. Fixes: https://github.com/helix-editor/helix/issues/1472 Superseds: https://github.com/helix-editor/helix/pull/4398 * open files inside helix * address code review * bump deps * fix based on code review comments --- Cargo.lock | 38 +++++++++++++++++++ helix-term/Cargo.toml | 4 ++ helix-term/src/commands.rs | 76 +++++++++++++++++++++++++++++++++++--- helix-view/Cargo.toml | 2 +- 4 files changed, 114 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fda89964c..544a13bb6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1237,6 +1237,7 @@ dependencies = [ "log", "nucleo", "once_cell", + "open", "pulldown-cmark", "serde", "serde_json", @@ -1247,6 +1248,7 @@ dependencies = [ "tokio", "tokio-stream", "toml", + "url", "which", ] @@ -1410,6 +1412,25 @@ version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "itoa" version = "1.0.6" @@ -1610,6 +1631,17 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +[[package]] +name = "open" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfabf1927dce4d6fdf563d63328a0a506101ced3ec780ca2135747336c98cef8" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -1639,6 +1671,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "percent-encoding" version = "2.3.0" diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index c6374de54..378f25f87 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -57,6 +57,10 @@ pulldown-cmark = { version = "0.9", default-features = false } # file type detection content_inspector = "0.2.4" +# opening URLs +open = "5.0.0" +url = "2.4.1" + # config toml = "0.7" diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index f1d1df063..bc54abaaf 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -60,8 +60,13 @@ use crate::{ use crate::job::{self, Jobs}; use futures_util::{stream::FuturesUnordered, TryStreamExt}; -use std::{collections::HashMap, fmt, future::Future}; -use std::{collections::HashSet, num::NonZeroUsize}; +use std::{ + collections::{HashMap, HashSet}, + fmt, + future::Future, + io::Read, + num::NonZeroUsize, +}; use std::{ borrow::Cow, @@ -70,6 +75,7 @@ use std::{ use once_cell::sync::Lazy; use serde::de::{self, Deserialize, Deserializer}; +use url::Url; use grep_regex::RegexMatcherBuilder; use grep_searcher::{sinks, BinaryDetection, SearcherBuilder}; @@ -331,7 +337,7 @@ impl MappableCommand { goto_implementation, "Goto implementation", goto_file_start, "Goto line number else file start", goto_file_end, "Goto file end", - goto_file, "Goto files in selection", + goto_file, "Goto files/URLs in selection", goto_file_hsplit, "Goto files in selection (hsplit)", goto_file_vsplit, "Goto files in selection (vsplit)", goto_reference, "Goto references", @@ -1190,10 +1196,53 @@ fn goto_file_impl(cx: &mut Context, action: Action) { .to_string(), ); } + for sel in paths { let p = sel.trim(); - if !p.is_empty() { - let path = &rel_path.join(p); + if p.is_empty() { + continue; + } + + if let Ok(url) = Url::parse(p) { + return open_url(cx, url, action); + } + + let path = &rel_path.join(p); + if path.is_dir() { + let picker = ui::file_picker(path.into(), &cx.editor.config()); + cx.push_layer(Box::new(overlaid(picker))); + } else if let Err(e) = cx.editor.open(path, action) { + cx.editor.set_error(format!("Open file failed: {:?}", e)); + } + } +} + +/// Opens the given url. If the URL points to a valid textual file it is open in helix. +// Otherwise, the file is open using external program. +fn open_url(cx: &mut Context, url: Url, action: Action) { + let doc = doc!(cx.editor); + let rel_path = doc + .relative_path() + .map(|path| path.parent().unwrap().to_path_buf()) + .unwrap_or_default(); + + if url.scheme() != "file" { + return open_external_url(cx, url); + } + + let content_type = std::fs::File::open(url.path()).and_then(|file| { + // Read up to 1kb to detect the content type + let mut read_buffer = Vec::new(); + let n = file.take(1024).read_to_end(&mut read_buffer)?; + Ok(content_inspector::inspect(&read_buffer[..n])) + }); + + // we attempt to open binary files - files that can't be open in helix - using external + // program as well, e.g. pdf files or images + match content_type { + Ok(content_inspector::ContentType::BINARY) => open_external_url(cx, url), + Ok(_) | Err(_) => { + let path = &rel_path.join(url.path()); if path.is_dir() { let picker = ui::file_picker(path.into(), &cx.editor.config()); cx.push_layer(Box::new(overlaid(picker))); @@ -1204,6 +1253,23 @@ fn goto_file_impl(cx: &mut Context, action: Action) { } } +/// Opens URL in external program. +fn open_external_url(cx: &mut Context, url: Url) { + let commands = open::commands(url.as_str()); + cx.jobs.callback(async { + for cmd in commands { + let mut command = tokio::process::Command::new(cmd.get_program()); + command.args(cmd.get_args()); + if command.output().await.is_ok() { + return Ok(job::Callback::Editor(Box::new(|_| {}))); + } + } + Ok(job::Callback::Editor(Box::new(move |editor| { + editor.set_error("Opening URL in external program failed") + }))) + }); +} + fn extend_word_impl(cx: &mut Context, extend_fn: F) where F: Fn(RopeSlice, Range, usize) -> Range, diff --git a/helix-view/Cargo.toml b/helix-view/Cargo.toml index 6218e9e41..a5218b9ac 100644 --- a/helix-view/Cargo.toml +++ b/helix-view/Cargo.toml @@ -26,7 +26,7 @@ helix-vcs = { version = "0.6", path = "../helix-vcs" } # Conversion traits once_cell = "1.18" -url = "2" +url = "2.4.1" arc-swap = { version = "1.6.0" } From 47b6c4bc78d449e3586f28d26507bfc8fb8608e2 Mon Sep 17 00:00:00 2001 From: Bjorn Ove Hay Andersen Date: Tue, 21 Nov 2023 12:07:00 +0100 Subject: [PATCH 106/393] Resolve args.files before changing directory (#8676) * Resolve args.files before changing directory * Removed the open_cwd work-around now that the path is full * If -w is specified, use that as the working directory * Open the remaining files in the argument list, also when the first is a directory * Use an iterator access the files argument --- helix-term/src/application.rs | 23 +++++++++++++++-------- helix-term/src/args.rs | 1 - helix-term/src/main.rs | 12 +++++++----- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 43e1cdfc9..ed085749b 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -162,14 +162,19 @@ impl Application { // Unset path to prevent accidentally saving to the original tutor file. doc_mut!(editor).set_path(None); } else if !args.files.is_empty() { - if args.open_cwd { - // NOTE: The working directory is already set to args.files[0] in main() - editor.new_file(Action::VerticalSplit); - let picker = ui::file_picker(".".into(), &config.load().editor); + let mut files_it = args.files.into_iter().peekable(); + + // If the first file is a directory, skip it and open a picker + if let Some((first, _)) = files_it.next_if(|(p, _)| p.is_dir()) { + let picker = ui::file_picker(first, &config.load().editor); compositor.push(Box::new(overlaid(picker))); - } else { - let nr_of_files = args.files.len(); - for (i, (file, pos)) in args.files.into_iter().enumerate() { + } + + // If there are any more files specified, open them + if files_it.peek().is_some() { + let mut nr_of_files = 0; + for (file, pos) in files_it { + nr_of_files += 1; if file.is_dir() { return Err(anyhow::anyhow!( "expected a path to file, found a directory. (to open a directory pass it as first argument)" @@ -181,7 +186,7 @@ impl Application { // option. If neither of those two arguments are passed // in, just load the files normally. let action = match args.split { - _ if i == 0 => Action::VerticalSplit, + _ if nr_of_files == 1 => Action::VerticalSplit, Some(Layout::Vertical) => Action::VerticalSplit, Some(Layout::Horizontal) => Action::HorizontalSplit, None => Action::Load, @@ -208,6 +213,8 @@ impl Application { // does not affect views without pos since it is at the top let (view, doc) = current!(editor); align_view(doc, view, Align::Center); + } else { + editor.new_file(Action::VerticalSplit); } } else if stdin().is_tty() || cfg!(feature = "integration") { editor.new_file(Action::VerticalSplit); diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index 99ce39926..6a49889b6 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -17,7 +17,6 @@ pub struct Args { pub log_file: Option, pub config_file: Option, pub files: Vec<(PathBuf, Position)>, - pub open_cwd: bool, pub working_directory: Option, } diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index 6411a7c5f..a62c54a40 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -116,16 +116,18 @@ FLAGS: setup_logging(args.verbosity).context("failed to initialize logging")?; + // Before setting the working directory, resolve all the paths in args.files + for (path, _) in args.files.iter_mut() { + *path = helix_core::path::get_canonicalized_path(path); + } + // NOTE: Set the working directory early so the correct configuration is loaded. Be aware that // Application::new() depends on this logic so it must be updated if this changes. if let Some(path) = &args.working_directory { helix_loader::set_current_working_dir(path)?; - } - - // If the first file is a directory, it will be the working directory and a file picker will be opened - if let Some((path, _)) = args.files.first().filter(|p| p.0.is_dir()) { + } else if let Some((path, _)) = args.files.first().filter(|p| p.0.is_dir()) { + // If the first file is a directory, it will be the working directory unless -w was specified helix_loader::set_current_working_dir(path)?; - args.open_cwd = true; // Signal Application that we want to open the picker on "." } let config = match Config::load_default() { From 41b307b673a34183123585d63746cb756c1779ed Mon Sep 17 00:00:00 2001 From: chtenb Date: Wed, 22 Nov 2023 03:42:40 +0100 Subject: [PATCH 107/393] Fix precedence of ui.virtual.whitespace (#8750) --- helix-term/src/ui/document.rs | 84 +++++++++++++++++++++--------- helix-term/src/ui/editor.rs | 96 +++++++++++++++++++++-------------- helix-term/src/ui/picker.rs | 10 ++-- 3 files changed, 125 insertions(+), 65 deletions(-) diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs index 80da1c542..af218a840 100644 --- a/helix-term/src/ui/document.rs +++ b/helix-term/src/ui/document.rs @@ -97,7 +97,8 @@ pub fn render_document( doc: &Document, offset: ViewPosition, doc_annotations: &TextAnnotations, - highlight_iter: impl Iterator, + syntax_highlight_iter: impl Iterator, + overlay_highlight_iter: impl Iterator, theme: &Theme, line_decoration: &mut [Box], translated_positions: &mut [TranslatedPosition], @@ -109,7 +110,8 @@ pub fn render_document( offset, &doc.text_format(viewport.width, Some(theme)), doc_annotations, - highlight_iter, + syntax_highlight_iter, + overlay_highlight_iter, theme, line_decoration, translated_positions, @@ -157,7 +159,8 @@ pub fn render_text<'t>( offset: ViewPosition, text_fmt: &TextFormat, text_annotations: &TextAnnotations, - highlight_iter: impl Iterator, + syntax_highlight_iter: impl Iterator, + overlay_highlight_iter: impl Iterator, theme: &Theme, line_decorations: &mut [Box], translated_positions: &mut [TranslatedPosition], @@ -178,10 +181,16 @@ pub fn render_text<'t>( let (mut formatter, mut first_visible_char_idx) = DocumentFormatter::new_at_prev_checkpoint(text, text_fmt, text_annotations, offset.anchor); - let mut styles = StyleIter { + let mut syntax_styles = StyleIter { text_style: renderer.text_style, active_highlights: Vec::with_capacity(64), - highlight_iter, + highlight_iter: syntax_highlight_iter, + theme, + }; + let mut overlay_styles = StyleIter { + text_style: renderer.text_style, + active_highlights: Vec::with_capacity(64), + highlight_iter: overlay_highlight_iter, theme, }; @@ -193,7 +202,10 @@ pub fn render_text<'t>( }; let mut is_in_indent_area = true; let mut last_line_indent_level = 0; - let mut style_span = styles + let mut syntax_style_span = syntax_styles + .next() + .unwrap_or_else(|| (Style::default(), usize::MAX)); + let mut overlay_style_span = overlay_styles .next() .unwrap_or_else(|| (Style::default(), usize::MAX)); @@ -221,9 +233,16 @@ pub fn render_text<'t>( // skip any graphemes on visual lines before the block start if pos.row < row_off { - if char_pos >= style_span.1 { - style_span = if let Some(style_span) = styles.next() { - style_span + if char_pos >= syntax_style_span.1 { + syntax_style_span = if let Some(syntax_style_span) = syntax_styles.next() { + syntax_style_span + } else { + break; + } + } + if char_pos >= overlay_style_span.1 { + overlay_style_span = if let Some(overlay_style_span) = overlay_styles.next() { + overlay_style_span } else { break; } @@ -260,8 +279,15 @@ pub fn render_text<'t>( } // acquire the correct grapheme style - if char_pos >= style_span.1 { - style_span = styles.next().unwrap_or((Style::default(), usize::MAX)); + if char_pos >= syntax_style_span.1 { + syntax_style_span = syntax_styles + .next() + .unwrap_or((Style::default(), usize::MAX)); + } + if char_pos >= overlay_style_span.1 { + overlay_style_span = overlay_styles + .next() + .unwrap_or((Style::default(), usize::MAX)); } char_pos += grapheme.doc_chars(); @@ -275,22 +301,25 @@ pub fn render_text<'t>( pos, ); - let grapheme_style = if let GraphemeSource::VirtualText { highlight } = grapheme.source { - let style = renderer.text_style; - if let Some(highlight) = highlight { - style.patch(theme.highlight(highlight.0)) + let (syntax_style, overlay_style) = + if let GraphemeSource::VirtualText { highlight } = grapheme.source { + let mut style = renderer.text_style; + if let Some(highlight) = highlight { + style = style.patch(theme.highlight(highlight.0)) + } + (style, Style::default()) } else { - style - } - } else { - style_span.0 - }; + (syntax_style_span.0, overlay_style_span.0) + }; - let virt = grapheme.is_virtual(); + let is_virtual = grapheme.is_virtual(); renderer.draw_grapheme( grapheme.grapheme, - grapheme_style, - virt, + GraphemeStyle { + syntax_style, + overlay_style, + }, + is_virtual, &mut last_line_indent_level, &mut is_in_indent_area, pos, @@ -322,6 +351,11 @@ pub struct TextRenderer<'a> { pub viewport: Rect, } +pub struct GraphemeStyle { + syntax_style: Style, + overlay_style: Style, +} + impl<'a> TextRenderer<'a> { pub fn new( surface: &'a mut Surface, @@ -395,7 +429,7 @@ impl<'a> TextRenderer<'a> { pub fn draw_grapheme( &mut self, grapheme: Grapheme, - mut style: Style, + grapheme_style: GraphemeStyle, is_virtual: bool, last_indent_level: &mut usize, is_in_indent_area: &mut bool, @@ -405,9 +439,11 @@ impl<'a> TextRenderer<'a> { let is_whitespace = grapheme.is_whitespace(); // TODO is it correct to apply the whitespace style to all unicode white spaces? + let mut style = grapheme_style.syntax_style; if is_whitespace { style = style.patch(self.whitespace_style); } + style = style.patch(grapheme_style.overlay_style); let width = grapheme.width(); let space = if is_virtual { " " } else { &self.space }; diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 31195a4e5..6b85d9a33 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -124,16 +124,20 @@ impl EditorView { line_decorations.push(Box::new(line_decoration)); } - let mut highlights = + let syntax_highlights = Self::doc_syntax_highlights(doc, view.offset.anchor, inner.height, theme); - let overlay_highlights = Self::overlay_syntax_highlights( + + let mut overlay_highlights = + Self::empty_highlight_iter(doc, view.offset.anchor, inner.height); + let overlay_syntax_highlights = Self::overlay_syntax_highlights( doc, view.offset.anchor, inner.height, &text_annotations, ); - if !overlay_highlights.is_empty() { - highlights = Box::new(syntax::merge(highlights, overlay_highlights)); + if !overlay_syntax_highlights.is_empty() { + overlay_highlights = + Box::new(syntax::merge(overlay_highlights, overlay_syntax_highlights)); } for diagnostic in Self::doc_diagnostics_highlights(doc, theme) { @@ -142,12 +146,12 @@ impl EditorView { if diagnostic.is_empty() { continue; } - highlights = Box::new(syntax::merge(highlights, diagnostic)); + overlay_highlights = Box::new(syntax::merge(overlay_highlights, diagnostic)); } - let highlights: Box> = if is_focused { + if is_focused { let highlights = syntax::merge( - highlights, + overlay_highlights, Self::doc_selection_highlights( editor.mode(), doc, @@ -158,13 +162,11 @@ impl EditorView { ); let focused_view_elements = Self::highlight_focused_view_elements(view, doc, theme); if focused_view_elements.is_empty() { - Box::new(highlights) + overlay_highlights = Box::new(highlights) } else { - Box::new(syntax::merge(highlights, focused_view_elements)) + overlay_highlights = Box::new(syntax::merge(highlights, focused_view_elements)) } - } else { - Box::new(highlights) - }; + } let gutter_overflow = view.gutter_offset(doc) == 0; if !gutter_overflow { @@ -197,7 +199,8 @@ impl EditorView { doc, view.offset, &text_annotations, - highlights, + syntax_highlights, + overlay_highlights, theme, &mut line_decorations, &mut translated_positions, @@ -257,27 +260,39 @@ impl EditorView { .for_each(|area| surface.set_style(area, ruler_theme)) } - pub fn overlay_syntax_highlights( + fn viewport_byte_range( + text: helix_core::RopeSlice, + row: usize, + height: u16, + ) -> std::ops::Range { + // Calculate viewport byte ranges: + // Saturating subs to make it inclusive zero indexing. + let last_line = text.len_lines().saturating_sub(1); + let last_visible_line = (row + height as usize).saturating_sub(1).min(last_line); + let start = text.line_to_byte(row.min(last_line)); + let end = text.line_to_byte(last_visible_line + 1); + + start..end + } + + pub fn empty_highlight_iter( doc: &Document, anchor: usize, height: u16, - text_annotations: &TextAnnotations, - ) -> Vec<(usize, std::ops::Range)> { + ) -> Box> { let text = doc.text().slice(..); let row = text.char_to_line(anchor.min(text.len_chars())); - let range = { - // Calculate viewport byte ranges: - // Saturating subs to make it inclusive zero indexing. - let last_line = text.len_lines().saturating_sub(1); - let last_visible_line = (row + height as usize).saturating_sub(1).min(last_line); - let start = text.line_to_byte(row.min(last_line)); - let end = text.line_to_byte(last_visible_line + 1); - - start..end - }; - - text_annotations.collect_overlay_highlights(range) + // Calculate viewport byte ranges: + // Saturating subs to make it inclusive zero indexing. + let range = Self::viewport_byte_range(text, row, height); + Box::new( + [HighlightEvent::Source { + start: text.byte_to_char(range.start), + end: text.byte_to_char(range.end), + }] + .into_iter(), + ) } /// Get syntax highlights for a document in a view represented by the first line @@ -292,16 +307,7 @@ impl EditorView { let text = doc.text().slice(..); let row = text.char_to_line(anchor.min(text.len_chars())); - let range = { - // Calculate viewport byte ranges: - // Saturating subs to make it inclusive zero indexing. - let last_line = text.len_lines().saturating_sub(1); - let last_visible_line = (row + height as usize).saturating_sub(1).min(last_line); - let start = text.line_to_byte(row.min(last_line)); - let end = text.line_to_byte(last_visible_line + 1); - - start..end - }; + let range = Self::viewport_byte_range(text, row, height); match doc.syntax() { Some(syntax) => { @@ -334,6 +340,20 @@ impl EditorView { } } + pub fn overlay_syntax_highlights( + doc: &Document, + anchor: usize, + height: u16, + text_annotations: &TextAnnotations, + ) -> Vec<(usize, std::ops::Range)> { + let text = doc.text().slice(..); + let row = text.char_to_line(anchor.min(text.len_chars())); + + let range = Self::viewport_byte_range(text, row, height); + + text_annotations.collect_overlay_highlights(range) + } + /// Get highlight spans for document diagnostics pub fn doc_diagnostics_highlights( doc: &Document, diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 0214a3910..9ba453357 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -736,17 +736,20 @@ impl Picker { } } - let mut highlights = EditorView::doc_syntax_highlights( + let syntax_highlights = EditorView::doc_syntax_highlights( doc, offset.anchor, area.height, &cx.editor.theme, ); + + let mut overlay_highlights = + EditorView::empty_highlight_iter(doc, offset.anchor, area.height); for spans in EditorView::doc_diagnostics_highlights(doc, &cx.editor.theme) { if spans.is_empty() { continue; } - highlights = Box::new(helix_core::syntax::merge(highlights, spans)); + overlay_highlights = Box::new(helix_core::syntax::merge(overlay_highlights, spans)); } let mut decorations: Vec> = Vec::new(); @@ -777,7 +780,8 @@ impl Picker { offset, // TODO: compute text annotations asynchronously here (like inlay hints) &TextAnnotations::default(), - highlights, + syntax_highlights, + overlay_highlights, &cx.editor.theme, &mut decorations, &mut [], From 811d62d3b3699efb7b7ceb362f537979e5911871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 22 Nov 2023 16:00:28 +0900 Subject: [PATCH 108/393] Revert "Fix precedence of ui.virtual.whitespace (#8750)" This reverts commit 41b307b673a34183123585d63746cb756c1779ed. --- helix-term/src/ui/document.rs | 84 +++++++++--------------------- helix-term/src/ui/editor.rs | 96 ++++++++++++++--------------------- helix-term/src/ui/picker.rs | 10 ++-- 3 files changed, 65 insertions(+), 125 deletions(-) diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs index af218a840..80da1c542 100644 --- a/helix-term/src/ui/document.rs +++ b/helix-term/src/ui/document.rs @@ -97,8 +97,7 @@ pub fn render_document( doc: &Document, offset: ViewPosition, doc_annotations: &TextAnnotations, - syntax_highlight_iter: impl Iterator, - overlay_highlight_iter: impl Iterator, + highlight_iter: impl Iterator, theme: &Theme, line_decoration: &mut [Box], translated_positions: &mut [TranslatedPosition], @@ -110,8 +109,7 @@ pub fn render_document( offset, &doc.text_format(viewport.width, Some(theme)), doc_annotations, - syntax_highlight_iter, - overlay_highlight_iter, + highlight_iter, theme, line_decoration, translated_positions, @@ -159,8 +157,7 @@ pub fn render_text<'t>( offset: ViewPosition, text_fmt: &TextFormat, text_annotations: &TextAnnotations, - syntax_highlight_iter: impl Iterator, - overlay_highlight_iter: impl Iterator, + highlight_iter: impl Iterator, theme: &Theme, line_decorations: &mut [Box], translated_positions: &mut [TranslatedPosition], @@ -181,16 +178,10 @@ pub fn render_text<'t>( let (mut formatter, mut first_visible_char_idx) = DocumentFormatter::new_at_prev_checkpoint(text, text_fmt, text_annotations, offset.anchor); - let mut syntax_styles = StyleIter { + let mut styles = StyleIter { text_style: renderer.text_style, active_highlights: Vec::with_capacity(64), - highlight_iter: syntax_highlight_iter, - theme, - }; - let mut overlay_styles = StyleIter { - text_style: renderer.text_style, - active_highlights: Vec::with_capacity(64), - highlight_iter: overlay_highlight_iter, + highlight_iter, theme, }; @@ -202,10 +193,7 @@ pub fn render_text<'t>( }; let mut is_in_indent_area = true; let mut last_line_indent_level = 0; - let mut syntax_style_span = syntax_styles - .next() - .unwrap_or_else(|| (Style::default(), usize::MAX)); - let mut overlay_style_span = overlay_styles + let mut style_span = styles .next() .unwrap_or_else(|| (Style::default(), usize::MAX)); @@ -233,16 +221,9 @@ pub fn render_text<'t>( // skip any graphemes on visual lines before the block start if pos.row < row_off { - if char_pos >= syntax_style_span.1 { - syntax_style_span = if let Some(syntax_style_span) = syntax_styles.next() { - syntax_style_span - } else { - break; - } - } - if char_pos >= overlay_style_span.1 { - overlay_style_span = if let Some(overlay_style_span) = overlay_styles.next() { - overlay_style_span + if char_pos >= style_span.1 { + style_span = if let Some(style_span) = styles.next() { + style_span } else { break; } @@ -279,15 +260,8 @@ pub fn render_text<'t>( } // acquire the correct grapheme style - if char_pos >= syntax_style_span.1 { - syntax_style_span = syntax_styles - .next() - .unwrap_or((Style::default(), usize::MAX)); - } - if char_pos >= overlay_style_span.1 { - overlay_style_span = overlay_styles - .next() - .unwrap_or((Style::default(), usize::MAX)); + if char_pos >= style_span.1 { + style_span = styles.next().unwrap_or((Style::default(), usize::MAX)); } char_pos += grapheme.doc_chars(); @@ -301,25 +275,22 @@ pub fn render_text<'t>( pos, ); - let (syntax_style, overlay_style) = - if let GraphemeSource::VirtualText { highlight } = grapheme.source { - let mut style = renderer.text_style; - if let Some(highlight) = highlight { - style = style.patch(theme.highlight(highlight.0)) - } - (style, Style::default()) + let grapheme_style = if let GraphemeSource::VirtualText { highlight } = grapheme.source { + let style = renderer.text_style; + if let Some(highlight) = highlight { + style.patch(theme.highlight(highlight.0)) } else { - (syntax_style_span.0, overlay_style_span.0) - }; + style + } + } else { + style_span.0 + }; - let is_virtual = grapheme.is_virtual(); + let virt = grapheme.is_virtual(); renderer.draw_grapheme( grapheme.grapheme, - GraphemeStyle { - syntax_style, - overlay_style, - }, - is_virtual, + grapheme_style, + virt, &mut last_line_indent_level, &mut is_in_indent_area, pos, @@ -351,11 +322,6 @@ pub struct TextRenderer<'a> { pub viewport: Rect, } -pub struct GraphemeStyle { - syntax_style: Style, - overlay_style: Style, -} - impl<'a> TextRenderer<'a> { pub fn new( surface: &'a mut Surface, @@ -429,7 +395,7 @@ impl<'a> TextRenderer<'a> { pub fn draw_grapheme( &mut self, grapheme: Grapheme, - grapheme_style: GraphemeStyle, + mut style: Style, is_virtual: bool, last_indent_level: &mut usize, is_in_indent_area: &mut bool, @@ -439,11 +405,9 @@ impl<'a> TextRenderer<'a> { let is_whitespace = grapheme.is_whitespace(); // TODO is it correct to apply the whitespace style to all unicode white spaces? - let mut style = grapheme_style.syntax_style; if is_whitespace { style = style.patch(self.whitespace_style); } - style = style.patch(grapheme_style.overlay_style); let width = grapheme.width(); let space = if is_virtual { " " } else { &self.space }; diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 6b85d9a33..31195a4e5 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -124,20 +124,16 @@ impl EditorView { line_decorations.push(Box::new(line_decoration)); } - let syntax_highlights = + let mut highlights = Self::doc_syntax_highlights(doc, view.offset.anchor, inner.height, theme); - - let mut overlay_highlights = - Self::empty_highlight_iter(doc, view.offset.anchor, inner.height); - let overlay_syntax_highlights = Self::overlay_syntax_highlights( + let overlay_highlights = Self::overlay_syntax_highlights( doc, view.offset.anchor, inner.height, &text_annotations, ); - if !overlay_syntax_highlights.is_empty() { - overlay_highlights = - Box::new(syntax::merge(overlay_highlights, overlay_syntax_highlights)); + if !overlay_highlights.is_empty() { + highlights = Box::new(syntax::merge(highlights, overlay_highlights)); } for diagnostic in Self::doc_diagnostics_highlights(doc, theme) { @@ -146,12 +142,12 @@ impl EditorView { if diagnostic.is_empty() { continue; } - overlay_highlights = Box::new(syntax::merge(overlay_highlights, diagnostic)); + highlights = Box::new(syntax::merge(highlights, diagnostic)); } - if is_focused { + let highlights: Box> = if is_focused { let highlights = syntax::merge( - overlay_highlights, + highlights, Self::doc_selection_highlights( editor.mode(), doc, @@ -162,11 +158,13 @@ impl EditorView { ); let focused_view_elements = Self::highlight_focused_view_elements(view, doc, theme); if focused_view_elements.is_empty() { - overlay_highlights = Box::new(highlights) + Box::new(highlights) } else { - overlay_highlights = Box::new(syntax::merge(highlights, focused_view_elements)) + Box::new(syntax::merge(highlights, focused_view_elements)) } - } + } else { + Box::new(highlights) + }; let gutter_overflow = view.gutter_offset(doc) == 0; if !gutter_overflow { @@ -199,8 +197,7 @@ impl EditorView { doc, view.offset, &text_annotations, - syntax_highlights, - overlay_highlights, + highlights, theme, &mut line_decorations, &mut translated_positions, @@ -260,39 +257,27 @@ impl EditorView { .for_each(|area| surface.set_style(area, ruler_theme)) } - fn viewport_byte_range( - text: helix_core::RopeSlice, - row: usize, - height: u16, - ) -> std::ops::Range { - // Calculate viewport byte ranges: - // Saturating subs to make it inclusive zero indexing. - let last_line = text.len_lines().saturating_sub(1); - let last_visible_line = (row + height as usize).saturating_sub(1).min(last_line); - let start = text.line_to_byte(row.min(last_line)); - let end = text.line_to_byte(last_visible_line + 1); - - start..end - } - - pub fn empty_highlight_iter( + pub fn overlay_syntax_highlights( doc: &Document, anchor: usize, height: u16, - ) -> Box> { + text_annotations: &TextAnnotations, + ) -> Vec<(usize, std::ops::Range)> { let text = doc.text().slice(..); let row = text.char_to_line(anchor.min(text.len_chars())); - // Calculate viewport byte ranges: - // Saturating subs to make it inclusive zero indexing. - let range = Self::viewport_byte_range(text, row, height); - Box::new( - [HighlightEvent::Source { - start: text.byte_to_char(range.start), - end: text.byte_to_char(range.end), - }] - .into_iter(), - ) + let range = { + // Calculate viewport byte ranges: + // Saturating subs to make it inclusive zero indexing. + let last_line = text.len_lines().saturating_sub(1); + let last_visible_line = (row + height as usize).saturating_sub(1).min(last_line); + let start = text.line_to_byte(row.min(last_line)); + let end = text.line_to_byte(last_visible_line + 1); + + start..end + }; + + text_annotations.collect_overlay_highlights(range) } /// Get syntax highlights for a document in a view represented by the first line @@ -307,7 +292,16 @@ impl EditorView { let text = doc.text().slice(..); let row = text.char_to_line(anchor.min(text.len_chars())); - let range = Self::viewport_byte_range(text, row, height); + let range = { + // Calculate viewport byte ranges: + // Saturating subs to make it inclusive zero indexing. + let last_line = text.len_lines().saturating_sub(1); + let last_visible_line = (row + height as usize).saturating_sub(1).min(last_line); + let start = text.line_to_byte(row.min(last_line)); + let end = text.line_to_byte(last_visible_line + 1); + + start..end + }; match doc.syntax() { Some(syntax) => { @@ -340,20 +334,6 @@ impl EditorView { } } - pub fn overlay_syntax_highlights( - doc: &Document, - anchor: usize, - height: u16, - text_annotations: &TextAnnotations, - ) -> Vec<(usize, std::ops::Range)> { - let text = doc.text().slice(..); - let row = text.char_to_line(anchor.min(text.len_chars())); - - let range = Self::viewport_byte_range(text, row, height); - - text_annotations.collect_overlay_highlights(range) - } - /// Get highlight spans for document diagnostics pub fn doc_diagnostics_highlights( doc: &Document, diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 9ba453357..0214a3910 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -736,20 +736,17 @@ impl Picker { } } - let syntax_highlights = EditorView::doc_syntax_highlights( + let mut highlights = EditorView::doc_syntax_highlights( doc, offset.anchor, area.height, &cx.editor.theme, ); - - let mut overlay_highlights = - EditorView::empty_highlight_iter(doc, offset.anchor, area.height); for spans in EditorView::doc_diagnostics_highlights(doc, &cx.editor.theme) { if spans.is_empty() { continue; } - overlay_highlights = Box::new(helix_core::syntax::merge(overlay_highlights, spans)); + highlights = Box::new(helix_core::syntax::merge(highlights, spans)); } let mut decorations: Vec> = Vec::new(); @@ -780,8 +777,7 @@ impl Picker { offset, // TODO: compute text annotations asynchronously here (like inlay hints) &TextAnnotations::default(), - syntax_highlights, - overlay_highlights, + highlights, &cx.editor.theme, &mut decorations, &mut [], From db83eb0c506617b39798a0e5000063459f81ce6a Mon Sep 17 00:00:00 2001 From: chtenb Date: Wed, 22 Nov 2023 14:07:26 +0100 Subject: [PATCH 109/393] Document the bufferline scopes (#8880) * Document the bufferline scopes * Update book/src/themes.md Co-authored-by: Michael Davis --------- Co-authored-by: Michael Davis --- book/src/themes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/book/src/themes.md b/book/src/themes.md index a62c07fee..495b76856 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -296,6 +296,9 @@ These scopes are used for theming the editor interface: | `ui.statusline.insert` | Statusline mode during insert mode ([only if `editor.color-modes` is enabled][editor-section]) | | `ui.statusline.select` | Statusline mode during select mode ([only if `editor.color-modes` is enabled][editor-section]) | | `ui.statusline.separator` | Separator character in statusline | +| `ui.bufferline` | Style for the buffer line | +| `ui.bufferline.active` | Style for the active buffer in buffer line | +| `ui.bufferline.background` | Style for bufferline background | | `ui.popup` | Documentation popups (e.g. Space + k) | | `ui.popup.info` | Prompt for multiple key options | | `ui.window` | Borderlines separating splits | From f1b9c19fa91ea21b81cf912c24ef11bf267d7bc7 Mon Sep 17 00:00:00 2001 From: Ethan Brierley Date: Wed, 22 Nov 2023 18:24:34 +0100 Subject: [PATCH 110/393] add LSP for nushell (#8878) --- book/src/generated/lang-support.md | 2 +- languages.toml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index a7d45a461..f93624f61 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -105,7 +105,7 @@ | nickel | ✓ | | ✓ | `nls` | | nim | ✓ | ✓ | ✓ | `nimlangserver` | | nix | ✓ | | | `nil` | -| nu | ✓ | | | | +| nu | ✓ | | | `nu` | | nunjucks | ✓ | | | | | ocaml | ✓ | | ✓ | `ocamllsp` | | ocaml-interface | ✓ | | | `ocamllsp` | diff --git a/languages.toml b/languages.toml index 3dedf6715..afbf34557 100644 --- a/languages.toml +++ b/languages.toml @@ -47,6 +47,7 @@ mint = { command = "mint", args = ["ls"] } nil = { command = "nil" } nimlangserver = { command = "nimlangserver" } nls = { command = "nls" } +nu-lsp = { command = "nu", args = [ "--lsp" ] } ocamllsp = { command = "ocamllsp" } ols = { command = "ols", args = [] } omnisharp = { command = "OmniSharp", args = [ "--languageserver" ] } @@ -1783,6 +1784,7 @@ file-types = ["nu"] shebangs = ["nu"] comment-token = "#" indent = { tab-width = 2, unit = " " } +language-servers = [ "nu-lsp" ] [[grammar]] name = "nu" From ff095ebd9b47bd5b06f16baca8dea9202f8d3c68 Mon Sep 17 00:00:00 2001 From: ghashy <109857267+ghashy@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:27:25 +0300 Subject: [PATCH 111/393] DBML Language support (#8860) * DBML language support * DBML language support, highlights.scm added * DBML support * Update runtime/queries/dbml/highlights.scm Co-authored-by: Michael Davis * Update runtime/queries/dbml/highlights.scm Co-authored-by: Michael Davis * Update runtime/queries/dbml/highlights.scm Co-authored-by: Michael Davis * remove unnecessary block highlight * remove unnecessary line * remove index_block query --------- Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 12 ++++++++ runtime/queries/dbml/highlights.scm | 44 +++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 runtime/queries/dbml/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index f93624f61..c21ca2501 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -24,6 +24,7 @@ | cue | ✓ | | | `cuelsp` | | d | ✓ | ✓ | ✓ | `serve-d` | | dart | ✓ | | ✓ | `dart` | +| dbml | ✓ | | | | | devicetree | ✓ | | | | | dhall | ✓ | ✓ | | `dhall-lsp-server` | | diff | ✓ | | | | diff --git a/languages.toml b/languages.toml index afbf34557..ef4687af8 100644 --- a/languages.toml +++ b/languages.toml @@ -2930,3 +2930,15 @@ language-servers = [ "templ" ] [[grammar]] name = "templ" source = { git = "https://github.com/vrischmann/tree-sitter-templ", rev = "ea56ac0655243490a4929a988f4eaa91dfccc995" } + +[[language]] +name = "dbml" +scope = "source.dbml" +injection-regex = "dbml" +file-types = ["dbml"] +comment-token = ";" +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "dbml" +source = { git = "https://github.com/dynamotn/tree-sitter-dbml", rev = "2e2fa5640268c33c3d3f27f7e676f631a9c68fd9" } diff --git a/runtime/queries/dbml/highlights.scm b/runtime/queries/dbml/highlights.scm new file mode 100644 index 000000000..accc65b4c --- /dev/null +++ b/runtime/queries/dbml/highlights.scm @@ -0,0 +1,44 @@ + +; comments highlighting +(comment) @comment + +; keyword highlighting +(keyword_def) @keyword +(keyword_enum) @keyword +(keyword_ref) @keyword + +; identify blocks and definitions +(definition) @function + +; for identifiers +(identifier) @variable +(type) @keyword + +; Highlight special types for database/data types +("Project" ) @type +("Table" ) @type +("TableGroup" ) @type +("database_type" ) @variable + +; string and number constants +("'''") @constant.character.escape +(string) @string +(number) @constant.numeric + +; brackets +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +; brackets +[ + ":" + "." + "," +] @punctuation.delimiter + From 090ed97e0045bfad1e5bff8b96c61707b996b85a Mon Sep 17 00:00:00 2001 From: Alexis Mousset Date: Wed, 22 Nov 2023 19:04:10 +0100 Subject: [PATCH 112/393] Add modus operandi themes (#8728) --- runtime/themes/modus_operandi.toml | 194 ++++++++++++++++++ .../themes/modus_operandi_deuteranopia.toml | 46 +++++ runtime/themes/modus_operandi_tinted.toml | 45 ++++ runtime/themes/modus_operandi_tritanopia.toml | 73 +++++++ 4 files changed, 358 insertions(+) create mode 100644 runtime/themes/modus_operandi.toml create mode 100644 runtime/themes/modus_operandi_deuteranopia.toml create mode 100644 runtime/themes/modus_operandi_tinted.toml create mode 100644 runtime/themes/modus_operandi_tritanopia.toml diff --git a/runtime/themes/modus_operandi.toml b/runtime/themes/modus_operandi.toml new file mode 100644 index 000000000..2247bb3be --- /dev/null +++ b/runtime/themes/modus_operandi.toml @@ -0,0 +1,194 @@ +# Author: Alexis Mousset +# Adapted from https://protesilaos.com/emacs/modus-themes, by Protesilaos Stavrou +# Version 4.3.0 +# + +# Syntax highlighting +# ------------------- +"type" = "cyan-cooler" +"constructor" = "cyan-cooler" + +"constant" = "blue-cooler" +"constant.character.escape" = "magenta" + +"string" = "blue-warmer" +"string.regexp" = "magenta-faint" +"string.special" = "blue-faint" # used for colors in CSS + +"comment" = "fg-dim" + +"variable.parameter" = "cyan" +"variable.builtin" = "magenta-cooler" +"label" = "fg-dim" # used for language in markdown code blocks +"keyword" = "magenta-cooler" +"keyword.directive" = "red-cooler" +"function" = "magenta" +"function.macro" = "magenta-warmer" + +punctuation = "fg-dim" +"tag" = "magenta" +"attribute" = "cyan-cooler" +"namespace" = "blue-cooler" +"special" = "red-cooler" + +"markup.heading.marker" = "fg-dim" +"markup.heading.1" = { fg = "fg-main", modifiers = ["bold"] } +"markup.heading.2" = { fg = "yellow-faint", modifiers = ["bold"] } +"markup.heading.3" = { fg = "fg-alt", modifiers = ["bold"] } +"markup.heading.4" = { fg = "magenta", modifiers = ["bold"] } +"markup.heading.5" = { fg = "green-faint", modifiers = ["bold"] } +"markup.heading.6" = { fg = "red-faint", modifiers = ["bold"] } +"markup.list" = "fg-dim" +"markup.list.checked" = { fg = "yellow-warmer" } +"markup.list.unchecked" = { fg = "yellow-warmer" } +"markup.bold" = { modifiers = ["bold"] } +"markup.italic" = { modifiers = ["italic"] } +"markup.strikethrough" = { modifiers = ["crossed_out"] } +"markup.link.url" = { fg = "cyan" } +"markup.link.text" = { fg = "blue-warmer", modifiers = ["underlined"] } +"markup.raw.block" = { bg = "bg-dim" } +"markup.raw.inline" = { fg = "green-cooler" } + +"diff.plus" = { fg = "fg-added", bg = "bg-added" } +"diff.plus.gutter" = "green-intense" +"diff.minus" = { fg = "fg-removed", bg = "bg-removed" } +"diff.minus.gutter" = "red-intense" +"diff.delta" = { fg = "fg-changed", bg = "bg-changed" } +"diff.delta.gutter" = "yellow-intense" + +# User Interface +# -------------- + +"ui.background" = { bg = "bg-main" } + +"ui.linenr" = { fg = "fg-dim", bg = "bg-dim" } +"ui.linenr.selected" = { fg = "fg-main", bg = "bg-active" } + +"ui.statusline" = { fg = "fg-mode-line-active", bg = "bg-mode-line-active" } +"ui.statusline.inactive" = { fg = "fg-mode-line-inactive", bg = "bg-mode-line-inactive" } +"ui.statusline.normal" = { fg = "blue-warmer" } +"ui.statusline.insert" = { fg = "green-warmer" } +"ui.statusline.select" = { fg = "magenta-warmer" } + +"ui.popup" = { fg = "fg-main", bg = "bg-dim" } +"ui.window" = { fg = "fg-dim" } +"ui.help" = { fg = "fg-main", bg = "bg-dim" } +"ui.gutter" = { bg = "bg-dim" } +"ui.text" = "fg-main" +"ui.text.focus" = { fg = "fg-main", bg = "bg-completion", modifiers = ["bold"] } +"ui.text.inactive" = { fg = "fg-dim" } +"ui.virtual" = "bg-active" +"ui.virtual.ruler" = { bg = "bg-dim" } +"ui.virtual.inlay-hint" = { fg = "fg-dim", modifiers = ["italic"] } + +"ui.selection" = { fg = "fg-main", bg = "bg-inactive" } +"ui.selection.primary" = { fg = "fg-main", bg = "bg-active" } + +"ui.cursor" = { fg = "bg-main", bg = "fg-main" } +"ui.cursor.primary" = { fg = "bg-main", bg = "fg-dim" } +"ui.cursor.match" = { bg = "bg-paren-match" } +"ui.cursorline.primary" = { bg = "bg-hl-line" } + +"ui.highlight" = { bg = "bg-hl-line" } + +"ui.menu" = { fg = "fg-main", bg = "bg-dim" } +"ui.menu.selected" = { fg = "fg-main", bg = "bg-completion", modifiers = ["bold"] } +"ui.menu.scroll" = { fg = "fg-dim", bg = "bg-cyan-intense" } + +"diagnostic.error" = { underline = { color = "red-intense", style = "curl" } } +"diagnostic.warning" = { underline = { color = "yellow-intense", style = "curl" } } +"diagnostic.info" = { underline = { color = "cyan-intense", style = "curl" } } +"diagnostic.hint" = { underline = { color = "blue-intense", style = "curl" } } + +error = "red" +warning = "yellow-warmer" +info = "cyan-cooler" +hint = "blue-cooler" + +[palette] +# Basic values +bg-main = "#ffffff" +bg-dim = "#f2f2f2" +fg-main = "#000000" +fg-dim = "#595959" +fg-alt = "#193668" +bg-active = "#c4c4c4" +bg-inactive = "#e0e0e0" + +# Common accent foregrounds +red = "#a60000" +red-warmer = "#972500" +red-cooler = "#a0132f" +red-faint = "#7f0000" +red-intense = "#d00000" +green = "#006800" +green-warmer = "#316500" +green-cooler = "#00663f" +green-faint = "#2a5045" +green-intense = "#008900" +yellow = "#6f5500" +yellow-warmer = "#884900" +yellow-cooler = "#7a4f2f" +yellow-faint = "#624416" +yellow-intense = "#808000" +blue = "#0031a9" +blue-warmer = "#354fcf" +blue-cooler = "#0000b0" +blue-faint = "#003497" +blue-intense = "#0000ff" +magenta = "#721045" +magenta-warmer = "#8f0075" +magenta-cooler = "#531ab6" +magenta-faint = "#7c318f" +magenta-intense = "#dd22dd" +cyan = "#005e8b" +cyan-warmer = "#3f578f" +cyan-cooler = "#005f5f" +cyan-faint = "#005077" +cyan-intense = "#008899" + +# Common accent backgrounds +bg-red-intense = "#ff8f88" +bg-green-intense = "#8adf80" +bg-yellow-intense = "#f3d000" +bg-blue-intense = "#bfc9ff" +bg-magenta-intense = "#dfa0f0" +bg-cyan-intense = "#a4d5f9" + +bg-red-subtle = "#ffcfbf" +bg-green-subtle = "#b3fabf" +bg-yellow-subtle = "#fff576" +bg-blue-subtle = "#ccdfff" +bg-magenta-subtle = "#ffddff" +bg-cyan-subtle = "#bfefff" + +bg-red-nuanced = "#fff1f0" +bg-green-nuanced = "#ecf7ed" +bg-yellow-nuanced = "#fff3da" +bg-blue-nuanced = "#f3f3ff" +bg-magenta-nuanced = "#fdf0ff" +bg-cyan-nuanced = "#ebf6fa" + +# Special purpose +bg-completion = "#c0deff" +bg-hl-line = "#dae5ec" + +bg-mode-line-active = "#c8c8c8" +fg-mode-line-active = "#000000" +bg-mode-line-inactive = "#e6e6e6" +fg-mode-line-inactive = "#585858" + +modeline-err = "#7f0000" +modeline-warning = "#5f0070" +modeline-info = "#002580" + +# Diffs +bg-added = "#c1f2d1" +fg-added = "#005000" +bg-changed = "#ffdfa9" +fg-changed = "#553d00" +bg-removed = "#ffd8d5" +fg-removed = "#8f1313" + +# Paren match +bg-paren-match = "#5fcfff" diff --git a/runtime/themes/modus_operandi_deuteranopia.toml b/runtime/themes/modus_operandi_deuteranopia.toml new file mode 100644 index 000000000..28601d37f --- /dev/null +++ b/runtime/themes/modus_operandi_deuteranopia.toml @@ -0,0 +1,46 @@ +# Author: Alexis Mousset +# modus_operandi.toml variant +# +# This variant is optimized for users with red-green color deficiency (deuteranopia) + +inherits = "modus_operandi" + +"constant.character.escape" = "magenta" +"comment" = "yellow-cooler" +"function" = "magenta" +"tag" = "magenta" + +"ui.cursor" = { fg = "bg-main", bg = "blue-intense" } +"ui.cursor.primary.normal" = { fg = "bg-main", bg = "blue-intense" } + +"diagnostic.error" = { underline = { color = "yellow-intense", style = "curl" } } +"diagnostic.warning" = { underline = { color = "magenta-faint", style = "curl" } } +"diagnostic.info" = { underline = { color = "cyan", style = "curl" } } +"diagnostic.hint" = { underline = { color = "blue", style = "curl" } } + +error = "yellow-intense" +warning = "magenta-faint" +info = "cyan" +hint = "blue" + +[palette] + +yellow = "#695500" +yellow-warmer = "#973300" +yellow-cooler = "#77492f" + +bg-mode-line-active = "#d0d6ff" +fg-mode-line-active = "#0f0f0f" +border-mode-line-active = "#4f4f74" + +modeline-err = "#603a00" +modeline-warning = "#454500" +modeline-info = "#023d92" + +# Diffs +bg-added = "#d5d7ff" +fg-added = "#303099" +bg-changed = "#eecfdf" +fg-changed = "#6f1343" +bg-removed = "#f4f099" +fg-removed = "#553d00" diff --git a/runtime/themes/modus_operandi_tinted.toml b/runtime/themes/modus_operandi_tinted.toml new file mode 100644 index 000000000..14faf0e5a --- /dev/null +++ b/runtime/themes/modus_operandi_tinted.toml @@ -0,0 +1,45 @@ +# Author: Alexis Mousset +# modus_operandi.toml variant + +inherits = "modus_operandi" + +"comment" = "red-faint" + +"ui.cursor.primary" = { fg = "bg-main", bg = "red" } + +[palette] +# Basic values +bg-main = "#fbf7f0" +bg-dim = "#efe9dd" +bg-active = "#c9b9b0" +bg-inactive = "#dfd5cf" +border = "#9f9690" + +# Common accent backgrounds +bg-red-nuanced = "#ffe8f0" +bg-green-nuanced = "#e0f5e0" +bg-yellow-nuanced = "#f9ead0" +bg-blue-nuanced = "#ebebff" +bg-magenta-nuanced = "#f6e7ff" +bg-cyan-nuanced = "#e1f3fc" + +# Special purpose +bg-completion = "#f0c1cf" +bg-hl-line = "#f1d5d0" +bg-region = "#c2bcb5" + +bg-mode-line-active = "#cab9b2" +border-mode-line-active = "#545454" +bg-mode-line-inactive = "#dfd9cf" +border-mode-line-inactive = "#a59a94" + +bg-tab-bar = "#e0d4ce" +bg-tab-current = "#fbf7f0" +bg-tab-other = "#c8b8b2" + +# Diffs +bg-added = "#c3ebc1" +bg-removed = "#f4d0cf" + +# Paren match +bg-paren-match = "#7fdfcf" diff --git a/runtime/themes/modus_operandi_tritanopia.toml b/runtime/themes/modus_operandi_tritanopia.toml new file mode 100644 index 000000000..8149f653e --- /dev/null +++ b/runtime/themes/modus_operandi_tritanopia.toml @@ -0,0 +1,73 @@ +# Author: Alexis Mousset +# modus_operandi.toml variant +# +# This variant is optimized for users with blue-yellow color deficiency (tritanopia) + +inherits = "modus_operandi" + +"type" = "blue-warmer" +"constructor" = "blue-warmer" +"constant" = "green-cooler" +"constant.character.escape" = "red-cooler" +"string" = "cyan" +"comment" = "red-faint" +"variable.parameter" = "cyan-cooler" +"keyword" = "red-cooler" +"keyword.directive" = "red-warmer" +"function" = "cyan-warmer" +"function.macro" = "magenta" +"tag" = "red-cooler" + +"markup.heading.2" = { fg = "red-faint", modifiers = ["bold"] } +"markup.heading.3" = { fg = "cyan-faint", modifiers = ["bold"] } +"markup.heading.6" = { fg = "magenta-faint", modifiers = ["bold"] } +"markup.link.url" = { fg = "cyan-cooler" } +"markup.link.text" = { fg = "cyan", modifiers = ["underlined"] } + +"ui.cursor" = { fg = "bg-main", bg = "red-intense" } +"ui.cursor.primary.normal" = { fg = "bg-main", bg = "red-intense" } + +"diagnostic.error" = { underline = { color = "red-warmer", style = "curl" } } +"diagnostic.warning" = { underline = { color = "magenta", style = "curl" } } +"diagnostic.info" = { underline = { color = "cyan", style = "curl" } } +"diagnostic.hint" = { underline = { color = "blue", style = "curl" } } + +error = "red-warmer" +warning = "magenta" +info = "cyan" +hint = "blue" + +[palette] + +# Common accent foregrounds +red-warmer = "#b21100" +red-faint = "#702000" +yellow = "#695500" +yellow-warmer = "#973300" +yellow-cooler = "#77492f" +magenta-intense = "#cd22bd" +cyan-faint = "#004f5f" + +# Special purpose +bg-completion = "#afdfef" +bg-hover = "#ffafbc" +bg-hover-secondary = "#9fdfff" +bg-hl-line = "#dfeaec" + +bg-char-0 = "#ff908f" +bg-char-1 = "#bfbfff" +bg-char-2 = "#5fcfdf" + +bg-mode-line-active = "#afe0f2" +fg-mode-line-active = "#0f0f0f" +border-mode-line-active = "#2f4f44" + +modeline-err = "#8f0000" +modeline-warning = "#6f306f" +modeline-info = "#00445f" + +# Diffs +bg-added = "#b5e7ff" +fg-added = "#005079" +bg-changed = "#eecfdf" +fg-changed = "#6f1343" From 8b0ae3d27912799d59e4948ff11d3a5428e32ce4 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Sat, 25 Nov 2023 04:55:49 -0800 Subject: [PATCH 113/393] bump MSRV to 1.70.0 (#8877) * rust-toolchain.toml: bump MSRV to 1.70.0 With Firefox 120 released on 21 November 2023, the MSRV is now 1.70.0. * Fix cargo fmt with Rust 1.70.0 * Fix cargo clippy with Rust 1.70.0 * Fix cargo doc with Rust 1.70.0 * rust-toolchain.toml: add clippy component * .github: bump dtolnay/rust-toolchain to 1.70 * helix-term: bump rust-version to 1.70 * helix-view/gutter: use checked_ilog10 to count digits * helix-core/syntax: use MAIN_SEPARATOR_STR constant * helix-view/handlers/dap: use Display impl for displaying process spawn error * WIP: helix-term/commands: use checked math to assert ranges cannot overlap --- .github/workflows/build.yml | 6 +++--- helix-core/src/syntax.rs | 5 +---- helix-term/Cargo.toml | 2 +- helix-term/src/commands.rs | 16 +++++++++++----- helix-term/src/commands/lsp.rs | 2 +- helix-tui/src/buffer.rs | 4 ++-- helix-view/src/editor.rs | 11 +++-------- helix-view/src/gutter.rs | 3 +-- helix-view/src/handlers/dap.rs | 4 +--- rust-toolchain.toml | 4 ++-- 10 files changed, 26 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8c55fa4a..22151c378 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: uses: actions/checkout@v4 - name: Install stable toolchain - uses: dtolnay/rust-toolchain@1.65 + uses: dtolnay/rust-toolchain@1.70 - uses: Swatinem/rust-cache@v2 with: @@ -70,7 +70,7 @@ jobs: uses: actions/checkout@v4 - name: Install stable toolchain - uses: dtolnay/rust-toolchain@1.65 + uses: dtolnay/rust-toolchain@1.70 with: components: rustfmt, clippy @@ -97,7 +97,7 @@ jobs: uses: actions/checkout@v4 - name: Install stable toolchain - uses: dtolnay/rust-toolchain@1.65 + uses: dtolnay/rust-toolchain@1.70 - uses: Swatinem/rust-cache@v2 with: diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 36a1e5c97..8c7fc4e15 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -212,10 +212,7 @@ impl<'de> Deserialize<'de> for FileType { { match map.next_entry::()? { Some((key, suffix)) if key == "suffix" => Ok(FileType::Suffix({ - // FIXME: use `suffix.replace('/', std::path::MAIN_SEPARATOR_STR)` - // if MSRV is updated to 1.68 - let mut separator = [0; 1]; - suffix.replace('/', std::path::MAIN_SEPARATOR.encode_utf8(&mut separator)) + suffix.replace('/', std::path::MAIN_SEPARATOR_STR) })), Some((key, _value)) => Err(serde::de::Error::custom(format!( "unknown key in `file-types` list: {}", diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 378f25f87..672e6f847 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/helix-editor/helix" homepage = "https://helix-editor.com" include = ["src/**/*", "README.md"] default-run = "hx" -rust-version = "1.65" +rust-version = "1.70" [features] default = ["git"] diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index bc54abaaf..cd053266c 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1318,7 +1318,7 @@ fn extend_next_long_word_end(cx: &mut Context) { extend_word_impl(cx, movement::move_next_long_word_end) } -/// Separate branch to find_char designed only for char. +/// Separate branch to find_char designed only for `` char. // // This is necessary because the one document can have different line endings inside. And we // cannot predict what character to find when is pressed. On the current line it can be `lf` @@ -5606,12 +5606,18 @@ fn shell(cx: &mut compositor::Context, cmd: &str, behavior: &ShellBehavior) { }; // These `usize`s cannot underflow because selection ranges cannot overlap. - // Once the MSRV is 1.66.0 (mixed_integer_ops is stabilized), we can use checked - // arithmetic to assert this. - let anchor = (to as isize + offset - deleted_len as isize) as usize; + let anchor = to + .checked_add_signed(offset) + .expect("Selection ranges cannot overlap") + .checked_sub(deleted_len) + .expect("Selection ranges cannot overlap"); let new_range = Range::new(anchor, anchor + output_len).with_direction(range.direction()); ranges.push(new_range); - offset = offset + output_len as isize - deleted_len as isize; + offset = offset + .checked_add_unsigned(output_len) + .expect("Selection ranges cannot overlap") + .checked_sub_unsigned(deleted_len) + .expect("Selection ranges cannot overlap"); changes.push((from, to, Some(output))); } diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 57be1267c..874004616 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -49,7 +49,7 @@ use std::{ /// If there is no configured language server that supports the feature, this displays a status message. /// Using this macro in a context where the editor automatically queries the LSP /// (instead of when the user explicitly does so via a keybind like `gd`) -/// will spam the "No configured language server supports " status message confusingly. +/// will spam the "No configured language server supports \" status message confusingly. #[macro_export] macro_rules! language_server_with_feature { ($editor:expr, $doc:expr, $feature:expr) => {{ diff --git a/helix-tui/src/buffer.rs b/helix-tui/src/buffer.rs index 93e9fcf9b..51a864f5f 100644 --- a/helix-tui/src/buffer.rs +++ b/helix-tui/src/buffer.rs @@ -213,7 +213,7 @@ impl Buffer { && y < self.area.bottom() } - /// Returns the index in the Vec for the given global (x, y) coordinates. + /// Returns the index in the `Vec` for the given global (x, y) coordinates. /// /// Global coordinates are offset by the Buffer's area offset (`x`/`y`). /// @@ -242,7 +242,7 @@ impl Buffer { ((y - self.area.y) as usize) * (self.area.width as usize) + ((x - self.area.x) as usize) } - /// Returns the index in the Vec for the given global (x, y) coordinates, + /// Returns the index in the `Vec` for the given global (x, y) coordinates, /// or `None` if the coordinates are outside the buffer's area. fn index_of_opt(&self, x: u16, y: u16) -> Option { if self.in_bounds(x, y) { diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 7af28ccc6..5a81cb5d6 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -727,7 +727,7 @@ pub struct WhitespaceCharacters { impl Default for WhitespaceCharacters { fn default() -> Self { Self { - space: '·', // U+00B7 + space: '·', // U+00B7 nbsp: '⍽', // U+237D tab: '→', // U+2192 newline: '⏎', // U+23CE @@ -755,12 +755,13 @@ impl Default for IndentGuidesConfig { } /// Line ending configuration. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum LineEndingConfig { /// The platform's native line ending. /// /// `crlf` on Windows, otherwise `lf`. + #[default] Native, /// Line feed. LF, @@ -777,12 +778,6 @@ pub enum LineEndingConfig { Nel, } -impl Default for LineEndingConfig { - fn default() -> Self { - LineEndingConfig::Native - } -} - impl From for LineEnding { fn from(line_ending: LineEndingConfig) -> Self { match line_ending { diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs index 397dff4f4..ebdac9e23 100644 --- a/helix-view/src/gutter.rs +++ b/helix-view/src/gutter.rs @@ -9,8 +9,7 @@ use crate::{ }; fn count_digits(n: usize) -> usize { - // TODO: use checked_log10 when MSRV reaches 1.67 - std::iter::successors(Some(n), |&n| (n >= 10).then_some(n / 10)).count() + (usize::checked_ilog10(n).unwrap_or(0) + 1) as usize } pub type GutterFn<'doc> = Box Option