From 19d44b6fde2a7689ff32410c573106b9c8359236 Mon Sep 17 00:00:00 2001 From: Abderrahmane TAHRI JOUTI <302837+atahrijouti@users.noreply.github.com> Date: Sat, 16 Sep 2023 00:22:40 +0200 Subject: [PATCH 01/28] add cyan_light theme (#8293) Co-authored-by: Michael Davis --- runtime/themes/cyan_light.toml | 151 +++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 runtime/themes/cyan_light.toml diff --git a/runtime/themes/cyan_light.toml b/runtime/themes/cyan_light.toml new file mode 100644 index 000000000..2114054d0 --- /dev/null +++ b/runtime/themes/cyan_light.toml @@ -0,0 +1,151 @@ +# An approximation/port of the Cyan Light Theme from Jetbrains +# +# Original Color Scheme here https://plugins.jetbrains.com/plugin/12102-cyan-light-theme + +"attribute" = "blue" +"type" = "shade07" +"type.enum.variant" = "purple" +"constructor" = "shade07" + +"constant" = "darker_blue" +"constant.builtin.boolean" = "blue" +"constant.character" = "blue" +"constant.character.escape" = "dark_red" +"constant.numeric" = "blue" + +"string" = "green" +"string.regexp" = "blue" +"string.special" = { fg = "dark_red", modifiers = ["underlined"] } + +"comment" = "comment_gray" + +"variable" = "green_blue" +"variable.builtin" = { fg = "darker_blue" } +"variable.parameter" = "purple" +"variable.other.member" = "purple" + +"label" = { fg = "darker_blue", modifiers = ["underlined"] } +"punctuation" = "shade06" + +"keyword" = "darker_blue" +"keyword.control.exception" = "darker_blue" + +"operator" = "shade06" + +"function" = "shade07" +"function.macro" = "yellow" +"function.builtin" = { fg = "shade07", modifiers = ["italic"] } +"function.special" = "dark_red" +"function.method" = "dark_yellow" + +"tag" = "darker_blue" +"special" = "shade06" +"namespace" = "darker_blue" + +"markup.bold" = { fg = "shade06", modifiers = ["bold"] } +"markup.italic" = { fg = "shade06", modifiers = ["italic"] } +"markup.strikethrough" = { fg = "shade06", modifiers = ["crossed_out"] } +"markup.heading" = { fg = "purple" } +"markup.list" = "darker_blue" +"markup.list.numbered" = "darker_blue" +"markup.list.unnumbered" = "darker_blue" +"markup.link.url" = "shade06" +"markup.link.text" = { fg = "dark_blue", modifiers = ['underlined'] } +"markup.link.label" = "dark_blue" +"markup.quote" = "green" +"markup.raw" = "green" +"markup.raw.inline" = "green" +"markup.raw.block" = "green" + +"diff.plus" = "diff_green" +"diff.minus" = "diff_red" +"diff.delta" = "diff_blue" + +# ui specific +"ui.background" = { bg = "shade00" } +"ui.cursor" = { bg = "shade02" } +"ui.cursor.primary" = { bg = "cursor_blue" } +"ui.cursor.match" = { fg = "shade00", bg = "shade04" } +"ui.cursor.primary.select" = { bg = "light_purple" } +"ui.cursor.primary.insert" = { bg = "light_green" } + +"ui.selection" = { bg = "lighter_blue" } +"ui.selection.primary" = { bg = "lighter_blue" } + +"ui.highlight" = { bg = "faint_blue" } +"ui.cursorline.primary" = { bg = "faint_blue" } + +"ui.linenr" = { fg = "shade03" } +"ui.linenr.selected" = { fg = "shade04", bg = "faint_blue", modifiers = [ + "bold", +] } + +"ui.statusline" = { fg = "shade06", bg = "shade02" } +"ui.statusline.inactive" = { fg = "shade04", bg = "shade01" } +"ui.statusline.normal" = { fg = "shade00", bg = "blue" } +"ui.statusline.insert" = { fg = "shade00", bg = "green" } +"ui.statusline.select" = { fg = "shade00", bg = "purple" } + +"ui.popup" = { bg = "shade01", fg = "shade04" } +"ui.window" = { bg = "shade00", fg = "shade04" } +"ui.help" = { fg = "shade06", bg = "shade01" } +"ui.text" = "shade05" +"ui.text.focus" = { fg = "shade07", bg = "light_blue" } +"ui.virtual" = "shade03" +"ui.virtual.ruler" = { bg = "shade04" } +"ui.menu" = { fg = "shade05", bg = "shade01" } +"ui.menu.selected" = { fg = "shade07", bg = "light_blue" } + +"hint" = "shade04" +"info" = "light_blue" +"warning" = "orange" +"error" = "red" +"diagnostic" = { modifiers = [] } +"diagnostic.hint" = { underline = { color = "shade04", style = "line" } } +"diagnostic.info" = { underline = { color = "light_blue", style = "line" } } +"diagnostic.warning" = { underline = { color = "orange", style = "curl" } } +"diagnostic.error" = { underline = { color = "red", style = "curl" } } + +[palette] +shade00 = "#f2f3f7" +shade01 = "#dadde8" +shade02 = "#c1c6d9" +shade03 = "#a9b0ca" +shade04 = "#525c85" +shade05 = "#434b6c" +shade06 = "#343a54" +shade07 = "#25293c" + +background = "#f2f3f7" +foreground = "#25293c" + +comment_gray = "#808080" + +diff_blue = "#C3D6E8" +faint_blue = "#E8Eef1" +lighter_blue = "#d0eaff" +light_blue = "#99ccff" +cursor_blue = "#80bfff" +blue = "#0073E6" +dark_blue = "#185b93" +darker_blue = "#000080" + + +purple = "#660E7A" +light_purple = "#ED9CFF" + +diff_green = "#C9DEC1" +green = "#00733B" +light_green = "#5DCE87" +green_blue = "#458383" + + +yellow = "#808000" +dark_yellow = "#7A7A43" + +light_orange = "#f9c881" +orange = "#F49810" + +diff_red = "#EBBCBC" +red = "#d90016" +dark_red = "#7F0000" From 941dc6c614d684804c3580c4ae8b3c4368aab217 Mon Sep 17 00:00:00 2001 From: Cyrill Schenkel Date: Sat, 16 Sep 2023 02:04:44 +0200 Subject: [PATCH 02/28] add GNU assembler (gas) support #8291) --- book/src/generated/lang-support.md | 1 + languages.toml | 15 ++++++++++++++- runtime/queries/gas/highlights.scm | 21 +++++++++++++++++++++ runtime/queries/gas/injections.scm | 2 ++ runtime/queries/gas/textobjects.scm | 2 ++ 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/gas/highlights.scm create mode 100644 runtime/queries/gas/injections.scm create mode 100644 runtime/queries/gas/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index c1b0acfdb..9d036b73c 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -44,6 +44,7 @@ | forth | ✓ | | | `forth-lsp` | | fortran | ✓ | | ✓ | `fortls` | | fsharp | ✓ | | | `fsautocomplete` | +| gas | ✓ | ✓ | | | | gdscript | ✓ | ✓ | ✓ | | | gemini | ✓ | | | | | git-attributes | ✓ | | | | diff --git a/languages.toml b/languages.toml index 37d2e94cf..a6ff9c676 100644 --- a/languages.toml +++ b/languages.toml @@ -2495,7 +2495,7 @@ source = { git = "https://github.com/erasin/tree-sitter-po", rev = "417cee9abb20 [[language]] name = "nasm" scope = "source.nasm" -file-types = ["asm", "s", "S", "nasm"] +file-types = ["asm", "S", "nasm"] injection-regex = "n?asm" roots = [] comment-token = ";" @@ -2505,6 +2505,19 @@ indent = { tab-width = 8, unit = " " } name = "nasm" source = { git = "https://github.com/naclsn/tree-sitter-nasm", rev = "a0db15db6fcfb1bf2cc8702500e55e558825c48b" } +[[language]] +name = "gas" +scope = "source.gas" +file-types = ["s"] +injection-regex = "gas" +roots = [] +comment-token = "#" +indent = { tab-width = 8, unit = " " } + +[[grammar]] +name = "gas" +source = { git = "https://github.com/sirius94/tree-sitter-gas", rev = "60f443646b20edee3b7bf18f3a4fb91dc214259a" } + [[language]] name = "rst" scope = "source.rst" diff --git a/runtime/queries/gas/highlights.scm b/runtime/queries/gas/highlights.scm new file mode 100644 index 000000000..46cefcbab --- /dev/null +++ b/runtime/queries/gas/highlights.scm @@ -0,0 +1,21 @@ +(comment) @comment +(number) @constant.numeric +(directive_name) @keyword.directive +(symbol) @variable +(label) @function +(label) +(instruction_prefix) @keyword +(instruction_name) @function.special +(register) @constant.builtin +(string) @string +(char) @constant.character +(type) @type +(constant "$" @constant) +(operand_modifier) @attribute + +(expression + ["-" "+" "*" "/" "="] @operator) + +["(" ")"] @punctuation.bracket + +["," ":"] @punctuation.delimiter diff --git a/runtime/queries/gas/injections.scm b/runtime/queries/gas/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/gas/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/gas/textobjects.scm b/runtime/queries/gas/textobjects.scm new file mode 100644 index 000000000..4465c8768 --- /dev/null +++ b/runtime/queries/gas/textobjects.scm @@ -0,0 +1,2 @@ +(comment) @comment.inside +(comment)+ @comment.around From 0e556484b7dbb4078a416ef0b3d923a206e6670e Mon Sep 17 00:00:00 2001 From: Yoav Lavi Date: Sat, 16 Sep 2023 22:27:50 +0300 Subject: [PATCH 03/28] Add JSON highlighting for `flake.lock` files (#8304) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index a6ff9c676..543c3dcc5 100644 --- a/languages.toml +++ b/languages.toml @@ -317,7 +317,7 @@ indent = { tab-width = 2, unit = " " } name = "json" scope = "source.json" injection-regex = "json" -file-types = ["json", "jsonc", "arb", "ipynb", "geojson", "gltf"] +file-types = ["json", "jsonc", "arb", "ipynb", "geojson", "gltf", "flake.lock"] roots = [] language-servers = [ "vscode-json-language-server" ] auto-format = true From b4494e1dc54f342d8c765b793bf934ae730b5253 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 3 Feb 2023 23:09:55 +0100 Subject: [PATCH 04/28] queries/nix: add injection rule for python test scripts --- runtime/queries/nix/injections.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm index 1da63ce08..03a6dc368 100644 --- a/runtime/queries/nix/injections.scm +++ b/runtime/queries/nix/injections.scm @@ -6,6 +6,16 @@ (indented_string_expression (string_fragment) @injection.content)) (#set! injection.combined)) +; Common attribute keys corresponding to Python scripts, +; such as those for NixOS VM tests in nixpkgs/nixos/tests. +((binding + attrpath: (attrpath (identifier) @_path) + expression: (indented_string_expression + (string_fragment) @injection.content)) + (#match? @_path "(^|\\.)testScript$") + (#set! injection.language "python") + (#set! injection.combined)) + ; Common attribute keys corresponding to scripts, ; such as those of stdenv.mkDerivation. ((binding From 37e48f4307a79cbc4e54e045584ec816bcc245a5 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 15 Sep 2023 17:12:47 +0200 Subject: [PATCH 05/28] queries/nix: align match start for language comments This rule failed to override other ones because it started its matching later. --- runtime/queries/nix/injections.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm index 03a6dc368..9804b75be 100644 --- a/runtime/queries/nix/injections.scm +++ b/runtime/queries/nix/injections.scm @@ -5,6 +5,10 @@ ((((comment) @injection.language) . (indented_string_expression (string_fragment) @injection.content)) (#set! injection.combined)) +((binding + (comment) @injection.language + expression: (indented_string_expression (string_fragment) @injection.content)) + (#set! injection.combined)) ; Common attribute keys corresponding to Python scripts, ; such as those for NixOS VM tests in nixpkgs/nixos/tests. From 8b076e3851c868307223b6152de9a8de52fcb88f Mon Sep 17 00:00:00 2001 From: Yoav Lavi Date: Sat, 16 Sep 2023 23:31:19 +0300 Subject: [PATCH 06/28] Add `.editorconfig` highlighting as INI (#8308) --- languages.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 543c3dcc5..78d7f6e9d 100644 --- a/languages.toml +++ b/languages.toml @@ -2290,7 +2290,8 @@ file-types = [ "container", "volume", "kube", - "network" + "network", + ".editorconfig" ] injection-regex = "ini" comment-token = "#" From ca9a7d506e735abec8903c5d8e721e765f76a6f9 Mon Sep 17 00:00:00 2001 From: Yoav Lavi Date: Sun, 17 Sep 2023 18:29:14 +0300 Subject: [PATCH 07/28] add .babelrc highlighting (#8309) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 78d7f6e9d..387aee6af 100644 --- a/languages.toml +++ b/languages.toml @@ -317,7 +317,7 @@ indent = { tab-width = 2, unit = " " } name = "json" scope = "source.json" injection-regex = "json" -file-types = ["json", "jsonc", "arb", "ipynb", "geojson", "gltf", "flake.lock"] +file-types = ["json", "jsonc", "arb", "ipynb", "geojson", "gltf", "flake.lock", ".babelrc"] roots = [] language-servers = [ "vscode-json-language-server" ] auto-format = true From cb3924278372f8e065487b0785489ee6ad3cf660 Mon Sep 17 00:00:00 2001 From: NomisIV <47303199+NomisIV@users.noreply.github.com> Date: Sun, 17 Sep 2023 18:50:58 +0200 Subject: [PATCH 08/28] Use Maskhjarnas tree-sitter-purescript (#8306) --- book/src/generated/lang-support.md | 2 +- languages.toml | 5 +- runtime/queries/purescript/highlights.scm | 119 ++++++++++++++++++++- runtime/queries/purescript/injections.scm | 3 +- runtime/queries/purescript/locals.scm | 5 +- runtime/queries/purescript/textobjects.scm | 13 +++ 6 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 runtime/queries/purescript/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 9d036b73c..f65f268d0 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -122,7 +122,7 @@ | prolog | | | | `swipl` | | protobuf | ✓ | | ✓ | `bufls`, `pb` | | prql | ✓ | | | | -| purescript | ✓ | | | `purescript-language-server` | +| purescript | ✓ | ✓ | | `purescript-language-server` | | python | ✓ | ✓ | ✓ | `pylsp` | | qml | ✓ | | ✓ | `qmlls` | | r | ✓ | | | `R` | diff --git a/languages.toml b/languages.toml index 387aee6af..b0fc6344d 100644 --- a/languages.toml +++ b/languages.toml @@ -1003,7 +1003,10 @@ language-servers = [ "purescript-language-server" ] indent = { tab-width = 2, unit = " " } auto-format = true formatter = { command = "purs-tidy", args = ["format"] } -grammar = "haskell" + +[[grammar]] +name = "purescript" +source = { git = "https://github.com/maskhjarna/tree-sitter-purescript", rev = "5f5a030826849b7be17596d372967f60051b42bd" } [[language]] name = "zig" diff --git a/runtime/queries/purescript/highlights.scm b/runtime/queries/purescript/highlights.scm index ef073eb25..bbfdf16e7 100644 --- a/runtime/queries/purescript/highlights.scm +++ b/runtime/queries/purescript/highlights.scm @@ -1 +1,118 @@ -; inherits: haskell +; ---------------------------------------------------------------------------- +; Literals and comments + + (integer) @constant.numeric.integer + (exp_negation) @constant.numeric.integer + (exp_literal (float)) @constant.numeric.float + (char) @constant.character + (string) @string + + (con_unit) @constant.builtin ; unit, as in () + + (comment) @comment + + +; ---------------------------------------------------------------------------- +; Punctuation + + [ + "(" + ")" + "{" + "}" + "[" + "]" + ] @punctuation.bracket + + [ + (comma) + ";" + ] @punctuation.delimiter + + +; ---------------------------------------------------------------------------- +; Keywords, operators, includes + + [ + "if" + "then" + "else" + "case" + "of" + ] @keyword.control.conditional + + [ + "import" + "module" + ] @keyword.control.import + + [ + (operator) + (constructor_operator) + (type_operator) + (tycon_arrow) + (qualified_module) ; grabs the `.` (dot), ex: import System.IO + (all_names) + "=" + "|" + "::" + "=>" + "->" + "<-" + "\\" + "`" + "@" + ] @operator + + (qualified_module (module) @constructor) + (module) @namespace + (qualified_type (module) @namespace) + (qualified_variable (module) @namespace) + (import (module) @namespace) + + [ + (where) + "let" + "in" + "class" + "instance" + "derive" + "foreign" + "data" + "newtype" + "type" + "as" + "do" + "ado" + "forall" + "∀" + "infix" + "infixl" + "infixr" + ] @keyword + + +; ---------------------------------------------------------------------------- +; Functions and variables + + (signature name: (variable) @type) + (function name: (variable) @function) + + ; true or false +((variable) @constant.builtin.boolean + (#match? @constant.builtin.boolean "^(true|false)$")) + + (variable) @variable + + (exp_infix (variable) @operator) ; consider infix functions as operators + + ("@" @namespace) ; "as" pattern operator, e.g. x@Constructor + + +; ---------------------------------------------------------------------------- +; Types + + (type) @type + + (constructor) @constructor + diff --git a/runtime/queries/purescript/injections.scm b/runtime/queries/purescript/injections.scm index ef073eb25..321c90add 100644 --- a/runtime/queries/purescript/injections.scm +++ b/runtime/queries/purescript/injections.scm @@ -1 +1,2 @@ -; inherits: haskell +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/purescript/locals.scm b/runtime/queries/purescript/locals.scm index ef073eb25..ad67fe43f 100644 --- a/runtime/queries/purescript/locals.scm +++ b/runtime/queries/purescript/locals.scm @@ -1 +1,4 @@ -; inherits: haskell +(signature name: (variable)) @local.definition +(function name: (variable)) @local.definition +(pat_name (variable)) @local.definition +(exp_name (variable)) @local.reference diff --git a/runtime/queries/purescript/textobjects.scm b/runtime/queries/purescript/textobjects.scm new file mode 100644 index 000000000..5f8eaff73 --- /dev/null +++ b/runtime/queries/purescript/textobjects.scm @@ -0,0 +1,13 @@ +(comment) @comment.inside + +[ + (data) + (type) + (newtype) +] @class.around + +((signature)? (function rhs:(_) @function.inside)) @function.around +(exp_lambda) @function.around + +(data (type_variable) @parameter.inside) +(patterns (_) @parameter.inside) From 7fa5f341e931f9bdb4058e51ebf77276e9b82242 Mon Sep 17 00:00:00 2001 From: zetashift Date: Sun, 17 Sep 2023 20:23:19 +0200 Subject: [PATCH 09/28] Update Unison highlights (#8315) --- runtime/queries/unison/highlights.scm | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/runtime/queries/unison/highlights.scm b/runtime/queries/unison/highlights.scm index 8ec2b6ff2..956dc5824 100644 --- a/runtime/queries/unison/highlights.scm +++ b/runtime/queries/unison/highlights.scm @@ -10,14 +10,18 @@ [ (kw_forall) (unique_kw) + (structural_kw) (type_kw) (kw_equals) (do) + (ability) + (where) ] @keyword (kw_let) @keyword.function (type_kw) @keyword.storage.type (unique) @keyword.storage.modifier +(structural) @keyword.storage.modifier ("use") @keyword.control.import @@ -31,6 +35,7 @@ (arrow_symbol) (">") (or) + (and) (bang) ] @operator @@ -47,13 +52,22 @@ ;; Types (record_field name: (wordy_id) @variable.other.member type: (wordy_id) @type) -[ - (type_name) - (type_signature) - (effect) -] @type +(type_constructor (type_name (wordy_id) @constructor)) +(ability_declaration type_name: (wordy_id) @type type_arg: (wordy_id) @variable.parameter) +(effect (wordy_id) @special) ;; NOTE: an effect is just like a type, but in signature we special case it -(term_definition) @variable +;; Namespaces +(path) @namespace +(namespace) @namespace + +;; Terms +(type_signature term_name: (path)? @variable term_name: (wordy_id) @variable) +(type_signature (wordy_id) @type) +(type_signature (delayed (wordy_id)) @type) + +(term_definition param: (wordy_id) @variable.parameter) + +(function_application function_name: (path)? function_name: (wordy_id) @function) ;; Punctuation [ @@ -70,3 +84,4 @@ "]" ] @punctuation.bracket +(test_watch_expression (wordy_id) @keyword.directive) From 53500f6ebd9538876b033e8658d809884917c4e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:29:30 +0900 Subject: [PATCH 10/28] build(deps): bump libc from 0.2.147 to 0.2.148 (#8327) Bumps [libc](https://github.com/rust-lang/libc) from 0.2.147 to 0.2.148. - [Release notes](https://github.com/rust-lang/libc/releases) - [Commits](https://github.com/rust-lang/libc/compare/0.2.147...0.2.148) --- updated-dependencies: - dependency-name: libc 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 ++-- helix-term/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2a700a85..867083dc4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1626,9 +1626,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 5c7fd0dea..65e9743ea 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.147" +libc = "0.2.148" [target.'cfg(target_os = "macos")'.dependencies] crossterm = { version = "0.27", features = ["event-stream", "use-dev-tty"] } From 312c175aecf6238a58ed7c67e4b11e5c2599ef66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:29:46 +0900 Subject: [PATCH 11/28] build(deps): bump indoc from 2.0.3 to 2.0.4 (#8329) Bumps [indoc](https://github.com/dtolnay/indoc) from 2.0.3 to 2.0.4. - [Release notes](https://github.com/dtolnay/indoc/releases) - [Commits](https://github.com/dtolnay/indoc/compare/2.0.3...2.0.4) --- updated-dependencies: - dependency-name: indoc 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 ++-- helix-core/Cargo.toml | 2 +- helix-term/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 867083dc4..bccc33e07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1569,9 +1569,9 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c785eefb63ebd0e33416dfcb8d6da0bf27ce752843a45632a67bf10d4d4b5c4" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" [[package]] name = "io-close" diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 515443e03..912342438 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -53,4 +53,4 @@ parking_lot = "0.12" [dev-dependencies] quickcheck = { version = "1", default-features = false } -indoc = "2.0.3" +indoc = "2.0.4" diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 65e9743ea..878dcd1f9 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -79,5 +79,5 @@ helix-loader = { version = "0.6", path = "../helix-loader" } [dev-dependencies] smallvec = "1.11" -indoc = "2.0.3" +indoc = "2.0.4" tempfile = "3.8.0" From 3640623b453fa827ce620f4e4654273a1208a2b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:30:13 +0900 Subject: [PATCH 12/28] build(deps): bump chrono from 0.4.30 to 0.4.31 (#8328) Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.30 to 0.4.31. - [Release notes](https://github.com/chronotope/chrono/releases) - [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md) - [Commits](https://github.com/chronotope/chrono/compare/v0.4.30...v0.4.31) --- updated-dependencies: - dependency-name: chrono 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 bccc33e07..0546a7bf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", From 1c88432efc3724f60b27d580b8b490040a3048f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:30:34 +0900 Subject: [PATCH 13/28] build(deps): bump serde_json from 1.0.105 to 1.0.107 (#8330) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.105 to 1.0.107. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.105...v1.0.107) --- updated-dependencies: - dependency-name: serde_json 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 0546a7bf0..eba11ac95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2112,9 +2112,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", From 651fd1ca7296bce719049e15cc1337fd72d1c918 Mon Sep 17 00:00:00 2001 From: postsolar <120750161+postsolar@users.noreply.github.com> Date: Thu, 21 Sep 2023 01:26:40 +0300 Subject: [PATCH 14/28] Add Unicode support to PureScript's highlight queries (#8338) --- runtime/queries/purescript/highlights.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/queries/purescript/highlights.scm b/runtime/queries/purescript/highlights.scm index bbfdf16e7..86deb48f6 100644 --- a/runtime/queries/purescript/highlights.scm +++ b/runtime/queries/purescript/highlights.scm @@ -56,9 +56,13 @@ "=" "|" "::" + "∷" "=>" + "⇒" "->" + "→" "<-" + "←" "\\" "`" "@" From 2284bce970e9175fd81851e1616218a6119354fc Mon Sep 17 00:00:00 2001 From: Alexis Mousset Date: Thu, 21 Sep 2023 00:28:36 +0200 Subject: [PATCH 15/28] Allow specifying a different style for diff indicator in vcs gutter. (#8343) This allows using a background in diff style (for nice patch file coloring) while keeping the gutter indicator nice (and using appropriate colors). --- book/src/themes.md | 3 +++ helix-view/src/gutter.rs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/book/src/themes.md b/book/src/themes.md index 96d7c0eca..661210765 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -245,9 +245,12 @@ We use a similar set of scopes as - `diff` - version control changes - `plus` - additions + - `gutter` - gutter indicator - `minus` - deletions + - `gutter` - gutter indicator - `delta` - modifications - `moved` - renamed or moved files/changes + - `gutter` - gutter indicator #### Interface diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs index a332a8a32..397dff4f4 100644 --- a/helix-view/src/gutter.rs +++ b/helix-view/src/gutter.rs @@ -94,9 +94,9 @@ pub fn diff<'doc>( theme: &Theme, _is_focused: bool, ) -> GutterFn<'doc> { - let added = theme.get("diff.plus"); - let deleted = theme.get("diff.minus"); - let modified = theme.get("diff.delta"); + let added = theme.get("diff.plus.gutter"); + let deleted = theme.get("diff.minus.gutter"); + let modified = theme.get("diff.delta.gutter"); if let Some(diff_handle) = doc.diff_handle() { let hunks = diff_handle.load(); let mut hunk_i = 0; From 842687e8452322f860e22d135d5e8240ad29879c Mon Sep 17 00:00:00 2001 From: zefr0x <65136727+zefr0x@users.noreply.github.com> Date: Sat, 23 Sep 2023 04:50:44 +0300 Subject: [PATCH 16/28] Add `.webmanifest` as supported JSON files (#8342) Closes #8310 --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index b0fc6344d..965da6dde 100644 --- a/languages.toml +++ b/languages.toml @@ -317,7 +317,7 @@ indent = { tab-width = 2, unit = " " } name = "json" scope = "source.json" injection-regex = "json" -file-types = ["json", "jsonc", "arb", "ipynb", "geojson", "gltf", "flake.lock", ".babelrc"] +file-types = ["json", "jsonc", "arb", "ipynb", "geojson", "gltf", "webmanifest", "flake.lock", ".babelrc"] roots = [] language-servers = [ "vscode-json-language-server" ] auto-format = true From 7702e130ba93f885ac56be5818b93c544a00538f Mon Sep 17 00:00:00 2001 From: nerohd <145902536+nerohd@users.noreply.github.com> Date: Sun, 24 Sep 2023 12:33:43 +0100 Subject: [PATCH 17/28] add polkit policy files to xml detection (#8369) polkit policy files are just xml files, https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html for more info --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 965da6dde..081b36e20 100644 --- a/languages.toml +++ b/languages.toml @@ -2205,7 +2205,7 @@ source = { git = "https://github.com/Unoqwy/tree-sitter-kdl", rev = "e1cd292c6d1 name = "xml" scope = "source.xml" injection-regex = "xml" -file-types = ["xml", "mobileconfig", "plist", "xib", "storyboard", "svg", "xsd", "gml", "xaml", "gir", "rss", "atom", "opml"] +file-types = ["xml", "mobileconfig", "plist", "xib", "storyboard", "svg", "xsd", "gml", "xaml", "gir", "rss", "atom", "opml", "policy"] indent = { tab-width = 2, unit = " " } roots = [] From 17edbacfbd6209119039fdaa593da76474e78ea9 Mon Sep 17 00:00:00 2001 From: zefr0x <65136727+zefr0x@users.noreply.github.com> Date: Mon, 25 Sep 2023 04:18:26 +0300 Subject: [PATCH 18/28] Improve and complete Arabic translation for meta information (#8380) --- contrib/Helix.appdata.xml | 12 ++++++++++++ contrib/Helix.desktop | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/contrib/Helix.appdata.xml b/contrib/Helix.appdata.xml index f1b310db4..08f23b3e1 100644 --- a/contrib/Helix.appdata.xml +++ b/contrib/Helix.appdata.xml @@ -5,6 +5,7 @@ MPL-2.0 Helix A post-modern text editor + مُحَرِّرُ نُصُوصٍ سَابِقٌ لِعَهدِه

@@ -17,6 +18,17 @@

  • Smart, incremental syntax highlighting and code editing via tree-sitter
  • + +

    + مُحَرِّرُ نُصُوصٍ يَعمَلُ فِي الطَّرَفِيَّة، مُستَلهَمٌ مِن Kakoune وَ Neovim وَمَكتُوبٌ بِلُغَةِ رَست البَرمَجِيَّة. +

    +
      +
    • تَحرِيرٌ وَضعِيٌّ شَبيهٌ بِـVim
    • +
    • تَحدِيدَاتٌ لِلنَّصِ مُتَعَدِّدَة
    • +
    • دَعْمٌ مُدمَجٌ لِخَوادِمِ اللُّغَات
    • +
    • تَحرِيرُ التَّعلِيمَاتِ البَّرمَجِيَّةِ مَعَ تَمييزٍ لِلتَّركِيبِ النَّحُويِّ بِواسِطَةِ tree-sitter
    • +
    +
    Helix.desktop diff --git a/contrib/Helix.desktop b/contrib/Helix.desktop index 844286f84..25d5c3b1a 100644 --- a/contrib/Helix.desktop +++ b/contrib/Helix.desktop @@ -1,6 +1,7 @@ [Desktop Entry] Name=Helix GenericName=Text Editor +GenericName[ar]=مُحَرِّرُ نُصُوص GenericName[de]=Texteditor GenericName[fr]=Éditeur de texte GenericName[ru]=Текстовый редактор @@ -9,7 +10,7 @@ GenericName[tr]=Metin Düzenleyici Comment=Edit text files Comment[af]=Redigeer tekslêers Comment[am]=የጽሑፍ ፋይሎች ያስተካክሉ -Comment[ar]=حرّر ملفات نصية +Comment[ar]=مُحَرِّرُ مِلَفَّاتٍ نَصِّيَّة Comment[az]=Mətn fayllarını redaktə edin Comment[be]=Рэдагаваньне тэкставых файлаў Comment[bg]=Редактиране на текстови файлове @@ -79,6 +80,7 @@ Exec=hx %F Terminal=true Type=Application Keywords=Text;editor; +Keywords[ar]=نص;نصوص;محرر; Keywords[fr]=Texte;éditeur; Keywords[ru]=текст;текстовый редактор; Keywords[sr]=Текст;едитор; From 0252c7b162ae5f3ff18b03ed9fe947d61a301926 Mon Sep 17 00:00:00 2001 From: nerohd <145902536+nerohd@users.noreply.github.com> Date: Mon, 25 Sep 2023 02:44:35 +0100 Subject: [PATCH 19/28] add polkit rules files to javascript detection (#8370) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 081b36e20..7b249fc6e 100644 --- a/languages.toml +++ b/languages.toml @@ -546,7 +546,7 @@ name = "javascript" scope = "source.js" injection-regex = "(js|javascript)" language-id = "javascript" -file-types = ["js", "mjs", "cjs"] +file-types = ["js", "mjs", "cjs", "rules"] shebangs = ["node"] roots = [] comment-token = "//" From f520b16fcaa2bc13d8d72c09694d88717055d0fd Mon Sep 17 00:00:00 2001 From: A-Walrus <58790821+A-Walrus@users.noreply.github.com> Date: Mon, 25 Sep 2023 18:42:42 +0300 Subject: [PATCH 20/28] Style Bold/Italic/Strikethrough markdown in docs (#8385) * Style Bold/Italic/Strikthrough markdown in docs * Flatten to single match --- helix-term/src/ui/markdown.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index 1433381d5..3c8a98685 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -14,6 +14,7 @@ use helix_core::{ }; use helix_view::{ graphics::{Margin, Rect, Style}, + theme::Modifier, Theme, }; @@ -275,17 +276,21 @@ impl Markdown { ); lines.extend(tui_text.lines.into_iter()); } else { - let style = if let Some(Tag::Heading(level, ..)) = tags.last() { - match level { + let style = match tags.last() { + Some(Tag::Heading(level, ..)) => match level { HeadingLevel::H1 => heading_styles[0], HeadingLevel::H2 => heading_styles[1], HeadingLevel::H3 => heading_styles[2], HeadingLevel::H4 => heading_styles[3], HeadingLevel::H5 => heading_styles[4], HeadingLevel::H6 => heading_styles[5], + }, + Some(Tag::Emphasis) => text_style.add_modifier(Modifier::ITALIC), + Some(Tag::Strong) => text_style.add_modifier(Modifier::BOLD), + Some(Tag::Strikethrough) => { + text_style.add_modifier(Modifier::CROSSED_OUT) } - } else { - text_style + _ => text_style, }; spans.push(Span::styled(text, style)); } From 35cbe26f21b1446914075535985f459e8edd72d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:03:59 +0900 Subject: [PATCH 21/28] build(deps): bump unicode-width from 0.1.10 to 0.1.11 (#8393) 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 eba11ac95..f2e65f806 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2545,9 +2545,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "url" From d7b38e3e4a2cd77f33d26c8b5f1795e9b392c9d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:04:16 +0900 Subject: [PATCH 22/28] build(deps): bump smallvec from 1.11.0 to 1.11.1 (#8394) 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 f2e65f806..c244b1d0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2209,9 +2209,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smartstring" From b495ca429ad484e3c387d871a04a664252ebcd71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:04:48 +0900 Subject: [PATCH 23/28] build(deps): bump rustix from 0.38.13 to 0.38.14 (#8395) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c244b1d0b..02bdd57b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1455,7 +1455,7 @@ dependencies = [ "log", "once_cell", "parking_lot", - "rustix 0.38.13", + "rustix 0.38.14", "serde", "serde_json", "slotmap", @@ -2052,9 +2052,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" dependencies = [ "bitflags 2.4.0", "errno", @@ -2289,7 +2289,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.38.13", + "rustix 0.38.14", "windows-sys 0.48.0", ] @@ -2646,7 +2646,7 @@ dependencies = [ "dirs", "either", "once_cell", - "rustix 0.38.13", + "rustix 0.38.14", ] [[package]] From 01e281ce107e57cc1865a0e09e89a8e8c79f2a4e Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 25 Sep 2023 21:05:19 -0500 Subject: [PATCH 24/28] markdown: Recognize `` tags with attributes as code (#8397) --- helix-term/src/ui/markdown.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index 3c8a98685..4d0c0d4a5 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -184,7 +184,9 @@ impl Markdown { // Transform text in `` blocks into `Event::Code` let mut in_code = false; let parser = parser.filter_map(|event| match event { - Event::Html(tag) if *tag == *"" => { + Event::Html(tag) + if tag.starts_with("')) => + { in_code = true; None } From 2776233a6f732edb69e2adf853ad0cb8c12afc59 Mon Sep 17 00:00:00 2001 From: Ben Haines Date: Tue, 26 Sep 2023 12:05:42 -0400 Subject: [PATCH 25/28] update go highlight queries (#8399) --- runtime/queries/go/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/go/highlights.scm b/runtime/queries/go/highlights.scm index b2d81e45d..b45a11bee 100644 --- a/runtime/queries/go/highlights.scm +++ b/runtime/queries/go/highlights.scm @@ -24,7 +24,6 @@ ; Identifiers -((identifier) @constant (match? @constant "^[A-Z][A-Z\\d_]+$")) (const_spec name: (identifier) @constant) @@ -38,6 +37,7 @@ (type_spec name: (type_identifier) @constructor) (field_identifier) @variable.other.member +(keyed_element (literal_element (identifier) @variable.other.member)) (identifier) @variable (package_identifier) @namespace From 080a085fa796fe2b71b5932b704d465695fba824 Mon Sep 17 00:00:00 2001 From: woojiq <122799969+woojiq@users.noreply.github.com> Date: Tue, 26 Sep 2023 23:12:19 +0300 Subject: [PATCH 26/28] Filter out language servers which fail to spawn (#8374) --- helix-lsp/src/lib.rs | 40 +++++++++-------- helix-view/src/editor.rs | 97 ++++++++++++++++++++++------------------ 2 files changed, 75 insertions(+), 62 deletions(-) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index d29a21440..a4be923b2 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -749,36 +749,40 @@ impl Registry { } } - pub fn get( - &mut self, - language_config: &LanguageConfiguration, - doc_path: Option<&std::path::PathBuf>, - root_dirs: &[PathBuf], + pub fn get<'a>( + &'a mut self, + language_config: &'a LanguageConfiguration, + doc_path: Option<&'a std::path::PathBuf>, + root_dirs: &'a [PathBuf], enable_snippets: bool, - ) -> Result>> { - language_config - .language_servers - .iter() - .map(|LanguageServerFeatures { name, .. }| { + ) -> impl Iterator>)> + 'a { + language_config.language_servers.iter().map( + move |LanguageServerFeatures { name, .. }| { if let Some(clients) = self.inner.get(name) { if let Some((_, client)) = clients.iter().enumerate().find(|(i, client)| { client.try_add_doc(&language_config.roots, root_dirs, doc_path, *i == 0) }) { - return Ok((name.to_owned(), client.clone())); + return (name.to_owned(), Ok(client.clone())); } } - let client = self.start_client( + match self.start_client( name.clone(), language_config, doc_path, root_dirs, enable_snippets, - )?; - let clients = self.inner.entry(name.clone()).or_default(); - clients.push(client.clone()); - Ok((name.clone(), client)) - }) - .collect() + ) { + Ok(client) => { + self.inner + .entry(name.to_owned()) + .or_default() + .push(client.clone()); + (name.clone(), Ok(client)) + } + Err(err) => (name.to_owned(), Err(err)), + } + }, + ) } pub fn iter_clients(&self) -> impl Iterator> { diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 2265633df..7af28ccc6 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1188,71 +1188,80 @@ impl Editor { } /// Refreshes the language server for a given document - pub fn refresh_language_servers(&mut self, doc_id: DocumentId) -> Option<()> { + pub fn refresh_language_servers(&mut self, doc_id: DocumentId) { self.launch_language_servers(doc_id) } /// Launch a language server for a given document - fn launch_language_servers(&mut self, doc_id: DocumentId) -> Option<()> { + fn launch_language_servers(&mut self, doc_id: DocumentId) { if !self.config().lsp.enable { - return None; + return; } // if doc doesn't have a URL it's a scratch buffer, ignore it - let doc = self.documents.get_mut(&doc_id)?; - let doc_url = doc.url()?; + let Some(doc) = self.documents.get_mut(&doc_id) else { + return; + }; + let Some(doc_url) = doc.url() else { + return; + }; let (lang, path) = (doc.language.clone(), doc.path().cloned()); let config = doc.config.load(); let root_dirs = &config.workspace_lsp_roots; - // try to find language servers based on the language name - let language_servers = lang.as_ref().and_then(|language| { + // store only successfully started language servers + let language_servers = lang.as_ref().map_or_else(HashMap::default, |language| { self.language_servers .get(language, path.as_ref(), root_dirs, config.lsp.snippets) - .map_err(|e| { - log::error!( - "Failed to initialize the language servers for `{}` {{ {} }}", - language.scope(), - e - ) + .filter_map(|(lang, client)| match client { + Ok(client) => Some((lang, client)), + Err(err) => { + log::error!( + "Failed to initialize the language servers for `{}` - `{}` {{ {} }}", + language.scope(), + lang, + err + ); + None + } }) - .ok() + .collect::>() }); - if let Some(language_servers) = language_servers { - let language_id = doc.language_id().map(ToOwned::to_owned).unwrap_or_default(); + if language_servers.is_empty() { + return; + } - // only spawn new language servers if the servers aren't the same + let language_id = doc.language_id().map(ToOwned::to_owned).unwrap_or_default(); - let doc_language_servers_not_in_registry = - doc.language_servers.iter().filter(|(name, doc_ls)| { - language_servers - .get(*name) - .map_or(true, |ls| ls.id() != doc_ls.id()) - }); - - for (_, language_server) in doc_language_servers_not_in_registry { - tokio::spawn(language_server.text_document_did_close(doc.identifier())); - } - - let language_servers_not_in_doc = language_servers.iter().filter(|(name, ls)| { - doc.language_servers + // only spawn new language servers if the servers aren't the same + let doc_language_servers_not_in_registry = + doc.language_servers.iter().filter(|(name, doc_ls)| { + language_servers .get(*name) - .map_or(true, |doc_ls| ls.id() != doc_ls.id()) + .map_or(true, |ls| ls.id() != doc_ls.id()) }); - for (_, language_server) in language_servers_not_in_doc { - // TODO: this now races with on_init code if the init happens too quickly - tokio::spawn(language_server.text_document_did_open( - doc_url.clone(), - doc.version(), - doc.text(), - language_id.clone(), - )); - } - - doc.language_servers = language_servers; + for (_, language_server) in doc_language_servers_not_in_registry { + tokio::spawn(language_server.text_document_did_close(doc.identifier())); } - Some(()) + + let language_servers_not_in_doc = language_servers.iter().filter(|(name, ls)| { + doc.language_servers + .get(*name) + .map_or(true, |doc_ls| ls.id() != doc_ls.id()) + }); + + for (_, language_server) in language_servers_not_in_doc { + // TODO: this now races with on_init code if the init happens too quickly + tokio::spawn(language_server.text_document_did_open( + doc_url.clone(), + doc.version(), + doc.text(), + language_id.clone(), + )); + } + + doc.language_servers = language_servers; } fn _refresh(&mut self) { @@ -1454,7 +1463,7 @@ impl Editor { doc.set_version_control_head(self.diff_providers.get_current_head_name(&path)); let id = self.new_document(doc); - let _ = self.launch_language_servers(id); + self.launch_language_servers(id); id }; From 0c879d4edcd8644475f4fa809af2d9aaf6959eb0 Mon Sep 17 00:00:00 2001 From: Ken Micklas Date: Tue, 26 Sep 2023 16:19:24 -0400 Subject: [PATCH 27/28] Add shebangs for Makefiles (#8410) For example, this is standard for Debian rules files: https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#defaultrules --- languages.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/languages.toml b/languages.toml index 7b249fc6e..c12c4e82d 100644 --- a/languages.toml +++ b/languages.toml @@ -1087,6 +1087,7 @@ source = { git = "https://github.com/uyha/tree-sitter-cmake", rev = "6e51463ef30 name = "make" scope = "source.make" file-types = ["Makefile", "makefile", "make", "mk"] +shebangs = ["make", "gmake"] injection-regex = "(make|makefile|Makefile|mk)" roots = [] comment-token = "#" From ba06371499a8682effbd733f2692ae140b63284e Mon Sep 17 00:00:00 2001 From: Lucas Zebrowsky <78442275+Lu-Die-Milchkuh@users.noreply.github.com> Date: Tue, 26 Sep 2023 22:19:52 +0200 Subject: [PATCH 28/28] Fix missing HTML tag colorization in onedark theme (#8409) --- runtime/themes/onedark.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/themes/onedark.toml b/runtime/themes/onedark.toml index 21101ea75..1db2aff86 100644 --- a/runtime/themes/onedark.toml +++ b/runtime/themes/onedark.toml @@ -1,5 +1,6 @@ # Author : Gokul Soumya +"tag" = { fg = "red" } "attribute" = { fg = "yellow" } "comment" = { fg = "light-gray", modifiers = ["italic"] } "constant" = { fg = "cyan" }