From fe6b556f51e5dfac828e139131af99117b655efe Mon Sep 17 00:00:00 2001 From: Em Zhan Date: Wed, 13 Sep 2023 09:37:39 -0500 Subject: [PATCH 001/213] Fix search highlighting for the default docs theme (#8270) --- book/custom.css | 2 +- docs/CONTRIBUTING.md | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/book/custom.css b/book/custom.css index 0e812090e319..4b039125e78e 100644 --- a/book/custom.css +++ b/book/custom.css @@ -164,7 +164,7 @@ code.hljs { --searchresults-header-fg: #5f5f71; --searchresults-border-color: #5c5c68; --searchresults-li-bg: #242430; - --search-mark-bg: #acff5; + --search-mark-bg: #a2cff5; } .colibri .content .header { diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 982b2237e960..2be8f77c77de 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -29,9 +29,15 @@ files, run cargo xtask docgen ``` -inside the project. We use [xtask][xtask] as an ad-hoc task runner and -thus do not require any dependencies other than `cargo` (You don't have -to `cargo install` anything either). +inside the project. We use [xtask][xtask] as an ad-hoc task runner. + +To preview the book itself, install [mdbook][mdbook]. Then, run + +```shell +mdbook serve book +``` + +and visit [http://localhost:3000](http://localhost:3000). # Testing @@ -58,4 +64,5 @@ The current MSRV and future changes to the MSRV are listed in the [Firefox docum [architecture.md]: ./architecture.md [docs]: https://docs.helix-editor.com/ [xtask]: https://github.com/matklad/cargo-xtask +[mdbook]: https://rust-lang.github.io/mdBook/guide/installation.html [helpers.rs]: ../helix-term/tests/test/helpers.rs From 764172d5bce243e11c23b4540ce89968bcb2f643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Thu, 14 Sep 2023 00:37:53 +0200 Subject: [PATCH 002/213] Theme: Papercolor: Cleanup, linting and using inheritance (#8276) --- runtime/themes/papercolor-dark.toml | 183 ++++++----------- runtime/themes/papercolor-light.toml | 293 +++++++++++++++++---------- 2 files changed, 257 insertions(+), 219 deletions(-) diff --git a/runtime/themes/papercolor-dark.toml b/runtime/themes/papercolor-dark.toml index eaaa36dcf52c..6e6dc0c3352d 100644 --- a/runtime/themes/papercolor-dark.toml +++ b/runtime/themes/papercolor-dark.toml @@ -1,124 +1,75 @@ # Palette based on https://github.com/NLKNguyen/papercolor-theme # Author: Soc Virnyl Estela -"ui.linenr.selected" = { fg = "linenr_fg_selected" } -"ui.background" = {bg="background"} -"ui.text" = "foreground" -"ui.text.focus" = { fg = "selection_background", modifiers = ["bold"]} -"ui.selection" = {bg="selection_background", fg="selection_foreground"} -"ui.cursorline" = {bg="cursorline_background"} -"ui.highlight" = {bg="cursorline_background"} -"ui.statusline" = {bg="paper_bar_bg", fg="regular0"} -"ui.statusline.select" = {bg="background", fg="bright7"} -"ui.statusline.normal" = {bg="background", fg="bright3"} -"ui.statusline.inactive" = {bg="selection_foreground", fg="foreground"} -"ui.virtual.whitespace" = { fg = "regular5" } -"ui.virtual.ruler" = {bg="cursorline_background"} -"ui.cursor.match" = {bg = "regular5", fg = "regular0"} -"ui.cursor" = {bg = "regular5", fg = "background"} -"ui.window" = {bg = "#303030", fg = "bright2"} -"ui.help" = {bg = "background", fg = "bright2"} -"ui.popup" = {bg = "#303030", fg = "bright6"} -"ui.menu" = {bg = "#303030", fg = "bright6"} -"ui.menu.selected" = {bg = "#C6C6C6", fg="selection_foreground"} +inherits = "papercolor-light" -"markup.heading" = { fg = "regular4", modifiers = ["bold"] } -"markup.heading.1" = { fg = "bright2", modifiers = ["bold"] } -"markup.heading.2" = { fg = "bright5", modifiers = ["bold"] } -"markup.heading.3" = { fg = "bright3", modifiers = ["bold"] } -"markup.heading.4" = { fg = "bright5", modifiers = ["bold"] } -"markup.heading.5" = { fg = "bright5", modifiers = ["bold"] } -"markup.heading.6" = { fg = "bright5", modifiers = ["bold"] } -"markup.list" = "bright3" -"markup.bold" = { fg = "foreground", modifiers = ["bold"] } -"markup.italic" = { fg = "bright0", modifiers = ["italic"] } -"markup.strikethrough" = { modifiers = ["crossed_out"] } -"markup.link.url" = { fg = "bright6", modifiers = ["underlined"] } -"markup.link.text" = "bright2" -"markup.link.label" = { fg = "regular2", modifiers = ["bold"] } -"markup.raw" = "foreground" - -"string" = "foreground" -"attribute" = "bright7" -"keyword" = { fg = "regular4", modifiers = ["bold"]} -"keyword.directive" = "regular4" -"keyword.control.conditional" = "bright3" -"keyword.function" = "regular4" -"namespace" = "bright1" -"type" = "bright2" -"type.builtin" = { fg = "foreground", modifiers = ["bold"]} -"variable" = "foreground" -"variable.builtin" = "cyan" -"variable.other.member" = "cyan" -"variable.parameter" = "foreground" - -"special" = "#3E999F" -"function" = "bright6" -"constructor" = "regular4" -"function.builtin" = { fg = "foreground", modifiers = ["bold"]} -"function.macro" = { fg = "regular4", modifiers = ["bold"] } -"comment" = { fg = "#686868", modifiers = ["dim"] } -"ui.linenr" = { fg = "bright0" } -"module" = "regular4" -"constant" = "bright5" -"constant.builtin" = "bright6" -"constant.numeric" = "bright5" -"constant.character.escape" = { fg = "foreground", modifiers = ["bold"]} -"operator" = { fg = "regular4", modifiers = ["bold"]} - -"label" = { fg = "selection_background", modifiers = ["bold", "italic"] } - -"diff.plus" = "regular2" -"diff.delta" = "regular6" -"diff.minus" = "regular1" +[palette] +background = "#1c1c1c" +foreground = "#d0d0d0" -"warning" = "bright4" -"error" = "regular1" -"info" = "bright4" +regular0 = "#1c1c1c" # color00 "Background" +regular1 = "#af005f" # color01 "Negative" +regular2 = "#5faf00" # color02 "Positive" +regular3 = "#d7af5f" # color03 "Olive" +regular4 = "#5fafd7" # color04 "Neutral" / Aqua +regular5 = "#808080" # color05 "Comment" +regular6 = "#d7875f" # color06 "Navy" +regular7 = "#d0d0d0" # color07 "Foreground" +bright0 = "#585858" # color08 "Nontext" +bright1 = "#5faf5f" # color09 "Red" +bright2 = "#afd700" # color10 "Pink" +bright3 = "#af87d7" # color11 "Purple" +bright4 = "#ffaf00" # color12 "Accent" +bright5 = "#ff5faf" # color13 "Orange" +bright6 = "#00afaf" # color14 "Blue" +bright7 = "#5f8787" # color15 "Highlight" -"diagnostic.warning".underline = { color = "bright4", style = "curl" } -"diagnostic.error".underline = { color = "regular1", style = "curl" } -"diagnostic.info".underline = { color = "bright4", style = "curl" } -"diagnostic.hint".underline = { color = "bright4", style = "curl" } +selection_fg = "#000000" +selection_bg = "#8787af" +selection_secondary_fg = "#333333" +selection_secondary_bg = "#707097" +special = "#3e999f" +cursorline_bg = "#303030" +cursorline_secondary_bg = "#2a2a2a" +cursorcolumn_bg = "#303030" +cursorcolumn_secondary_bg = "#2a2a2a" +cursorlinenr_fg = "#ffff00" +popupmenu_fg = "#c6c6c6" +popupmenu_bg = "#303030" +linenumber_fg = "#585858" +vertsplit_fg = "#5f8787" +statusline_active_fg = "#1c1c1c" +statusline_active_bg = "#5f8787" +statusline_inactive_fg = "#bcbcbc" +statusline_inactive_bg = "#3a3a3a" +todo_fg = "#ff8700" +error_fg = "#af005f" +error_bg = "#5f0000" +matchparen_bg = "#4e4e4e" +matchparen_fg = "#c6c6c6" +wildmenu_fg = "#1c1c1c" +wildmenu_bg = "#afd700" +diffadd_fg = "#87d700" +diffadd_bg = "#005f00" +diffdelete_fg = "#af005f" +diffdelete_bg = "#5f0000" +diffchange_bg = "#005f5f" -[palette] -background="#1c1c1c" -foreground="#d0d0d0" -regular0="#1c1c1c" -regular1="#af005f" -regular2="#5faf00" -regular3="#d7af5f" -regular4="#5fafd7" -regular5="#808080" -regular6="#d7875f" -regular7="#d0d0d0" -bright0="#585858" -bright1="#5faf5f" -bright2="#afd700" -bright3="#af87d7" -bright4="#FFAF00" -bright5="#ff5faf" -bright6="#00afaf" -bright7="#5f8787" -selection_foreground="#585858" -selection_background="#8787AF" -cursorline_background="#303030" -paper_bar_bg="#5F8787" -black="#1c1c1c" -red="#af005f" -green="#5faf00" -yellow="#d7af5f" -blue="#5fafd7" -magenta="#808080" -cyan="#d7875f" -gray="#d0d0d0" -light-red="#5faf5f" -light-green="#afd700" -light-yellow="#af87d7" -light-blue="#FFAF00" -light-magenta="#ff5faf" -light-cyan="#00afaf" -light-gray="#5f8787" -white="#808080" -linenr_fg_selected="#FFFF00" +# 16 bit ANSI color names +black = "#1c1c1c" +red = "#af005f" +green = "#5faf00" +yellow = "#d7af5f" +blue = "#5fafd7" +magenta = "#808080" +cyan = "#d7875f" +white = "#d0d0d0" +light-black = "#585858" +light-red = "#5faf5f" +light-green = "#afd700" +light-yellow = "#af87d7" +light-blue = "#ffaf00" +light-magenta = "#ff5faf" +light-cyan = "#00afaf" +light-white = "#5f8787" diff --git a/runtime/themes/papercolor-light.toml b/runtime/themes/papercolor-light.toml index 63671e1b3ff7..ae104e17e0b5 100644 --- a/runtime/themes/papercolor-light.toml +++ b/runtime/themes/papercolor-light.toml @@ -1,31 +1,124 @@ # Palette based on https://github.com/NLKNguyen/papercolor-theme # Author: Soc Virnyl Estela -"ui.linenr.selected" = { fg = "linenr_fg_selected" } -"ui.background" = {bg="background"} +"ui.linenr.selected" = { fg = "cursorlinenr_fg", modifiers = ["bold"] } +"ui.linenr" = { fg = "linenumber_fg" } +"ui.background" = { bg = "background" } "ui.text" = "foreground" -"ui.text.focus" = { fg = "selection_background", modifiers = ["bold"]} -"ui.selection" = {bg="selection_background", fg="selection_foreground"} -"ui.highlight" = {bg="cursorline_background"} -"ui.cursorline" = {bg="cursorline_background"} -"ui.statusline" = {bg="paper_bar_bg", fg="regular0"} -"ui.statusline.select" = {bg="background", fg="bright7"} -"ui.statusline.normal" = {bg="background", fg="bright3"} -"ui.statusline.inactive" = {bg="bright0", fg="foreground"} -"ui.virtual" = "indent" +"ui.text.focus" = { fg = "selection_bg", modifiers = ["bold"] } +"ui.selection" = { bg = "selection_secondary_bg", fg = "selection_secondary_fg" } +"ui.selection.primary" = { bg = "selection_bg", fg = "selection_fg" } +"ui.highlight" = { bg = "cursorline_bg" } + +"ui.cursorline" = { bg = "cursorline_bg" } +"ui.cursorline.secondary" = { bg = "cursorline_secondary_bg" } +"ui.cursorcolumn" = { bg = "cursorline_bg" } +"ui.cursorcolumn.secondary" = { bg = "cursorcolumn_secondary_bg" } + +"ui.statusline" = { bg = "statusline_active_bg", fg = "statusline_active_fg" } +"ui.statusline.inactive" = { bg = "statusline_inactive_bg", fg = "statusline_inactive_fg" } +"ui.statusline.normal" = { bg = "statusline_inactive_bg", fg = "bright6" } +"ui.statusline.insert" = { bg = "statusline_inactive_bg", fg = "bright4" } +"ui.statusline.select" = { bg = "statusline_inactive_bg", fg = "regular3" } +"ui.statusline.separator" = { bg = "statusline_active_bg", fg = "statusline_active_bg" } + +"ui.virtual" = { fg = "cursorlinenr_fg" } "ui.virtual.whitespace" = { fg = "regular5" } -"ui.virtual.ruler" = {bg="cursorline_background"} -"ui.cursor.match" = {bg = "regular5", fg = "regular0"} -"ui.cursor" = {bg = "regular5", fg = "background"} -"ui.window" = {bg = "#D0D0D0", fg = "bright2"} -"ui.help" = {bg = "background", fg = "bright2"} -"ui.popup" = {bg = "#D0D0D0", fg = "bright7"} -"ui.menu" = {bg = "#D0D0D0", fg = "bright7"} -"ui.menu.selected" = {bg = "selection_background", fg="selection_foreground"} - -"markup.heading" = { fg = "bright7", modifiers = ["bold"] } +"ui.virtual.indent-guide" = { fg = "bright0" } +"ui.virtual.ruler" = { bg = "cursorline_secondary_bg", fg = "regular4" } +"ui.cursor.match" = { bg = "matchparen_bg", fg = "matchparen_fg" } +"ui.cursor" = { bg = "regular5", fg = "background" } +"ui.cursor.primary" = { bg = "foreground", fg = "background" } +"ui.window" = { fg = "vertsplit_fg" } +"ui.help" = { bg = "wildmenu_bg", fg = "wildmenu_fg" } +"ui.popup" = { bg = "popupmenu_bg", fg = "popupmenu_fg" } +"ui.popup.info" = { bg = "popupmenu_bg", fg = "bright7", modifiers = ["bold"] } +"ui.menu" = { bg = "popupmenu_bg", fg = "foreground" } +"ui.menu.selected" = { bg = "selection_bg", fg = "selection_fg" } + +"warning" = "bright5" +"error" = { bg = "error_bg", fg = "error_fg" } +"info" = "todo_fg" + +"diagnostic.warning" = { fg = "bright0", modifiers = [ + "dim", +], underline = { color = "bright5", style = "curl" } } +"diagnostic.error".underline = { color = "bright1", style = "curl" } +"diagnostic.info".underline = { color = "bright4", style = "curl" } +"diagnostic.hint".underline = { color = "bright6", style = "curl" } + +# Tree-sitter scopes for syntax highlighting +"attribute" = "bright4" + +"type" = { fg = "bright2", modifiers = ["bold"] } +"type.builtin" = { fg = "bright2", modifiers = ["bold"] } +"type.enum" = { fg = "foreground" } +"type.enum.variant" = { fg = "foreground" } + +"constructor" = "foreground" + +"constant" = "bright5" +"constant.builtin" = "regular3" +"constant.builtin.boolean" = { fg = "regular2", modifiers = ["bold"] } +"constant.character.escape" = { fg = "bright3", modifiers = ["bold"] } +"constant.character" = { fg = "regular3" } +"constant.numeric" = "bright5" + +"string" = "regular3" +"string.regexp" = "bright3" + +"comment" = { fg = "regular5", modifiers = ["italic"] } +"comment.line" = { fg = "regular5", modifiers = ["italic"] } +"comment.block" = { fg = "regular5", modifiers = ["italic"] } +"comment.block.documentation" = { fg = "regular5", modifiers = ["bold"] } + +"variable" = "foreground" +"variable.builtin" = "bright5" +"variable.other.member" = "foreground" +"variable.parameter" = "foreground" + +"label" = { fg = "selection_bg", modifiers = ["bold", "italic"] } + +"punctuation" = { fg = "foreground" } +"punctuation.delimiter" = { fg = "regular4", modifiers = ["bold"] } +"punctuation.bracket" = { fg = "foreground" } +"punctuation.special" = { fg = "bright1", modifiers = ["bold"] } + +"keyword" = { fg = "bright2" } +"keyword.control" = "bright1" +"keyword.control.conditional" = { fg = "bright3", modifiers = ["bold"] } +"keyword.control.repeat" = { fg = "bright3", modifiers = ["bold"] } +"keyword.control.import" = { fg = "bright2" } +"keyword.control.return" = { fg = "bright2" } +"keyword.control.exception" = { fg = "bright1" } + +"keyword.operator" = { fg = "regular4", modifiers = ["bold"] } +"keyword.directive" = "regular4" +"keyword.function" = "bright2" +"keyword.storage" = "bright2" +"keyword.storage.type" = { fg = "regular4", modifiers = ["bold"] } +"keyword.storage.modifier" = { fg = "regular6", modifiers = ["bold"] } +"keyword.storage.modifier.ref" = { fg = "regular4", modifiers = ["bold"] } +"keyword.special" = "bright1" + +"operator" = { fg = "regular4", modifiers = ["bold"] } + +"function" = { fg = "foreground" } +"function.builtin" = { fg = "bright6" } +"function.method" = { fg = "foreground" } +"function.macro" = { fg = "regular3", modifiers = ["bold"] } +"function.special" = { fg = "bright4" } + +"tag" = { fg = "regular4" } + +"namespace" = "bright6" + +"special" = "special" + +"markup.heading" = { fg = "bright4", modifiers = ["bold"] } +"markup.heading.marker" = { fg = "bright2", modifiers = ["bold"] } "markup.heading.1" = { fg = "bright2", modifiers = ["bold"] } -"markup.heading.2" = { fg = "bright4", modifiers = ["bold"] } +"markup.heading.2" = { fg = "bright5", modifiers = ["bold"] } "markup.heading.3" = { fg = "bright3", modifiers = ["bold"] } "markup.heading.4" = { fg = "bright4", modifiers = ["bold"] } "markup.heading.5" = { fg = "bright4", modifiers = ["bold"] } @@ -34,90 +127,84 @@ "markup.bold" = { fg = "foreground", modifiers = ["bold"] } "markup.italic" = { modifiers = ["italic"] } "markup.strikethrough" = { modifiers = ["crossed_out"] } -"markup.link.url" = { fg = "regular4", modifiers = ["underlined"] } +"markup.link.url" = { fg = "bright6", underline.style = "line" } "markup.link.text" = "bright2" -"markup.link.label" = { fg = "regular7", modifiers = ["bold"] } -"markup.raw" = "foreground" - -"string" = "foreground" -"attribute" = "bright7" -"keyword" = { fg = "regular4", modifiers = ["bold"]} -"keyword.directive" = "regular1" -"namespace" = "regular1" -"type" = "bright2" -"type.builtin" = { fg = "regular4", modifiers = ["bold"]} -"variable" = "foreground" -"variable.builtin" = "cyan" -"variable.other.member" = "regular4" -"variable.parameter" = "foreground" - -"special" = "#3E999F" -"function" = "bright1" -"constructor" = "bright1" -"function.builtin" = { fg = "regular4", modifiers = ["bold"]} -"function.macro" = { fg = "regular1" } -"comment" = { fg = "bright0", modifiers = ["dim"] } -"ui.linenr" = { fg = "bright0" } -"module" = "#af0000" -"constant" = "#5f8700" -"constant.builtin" = "#5f8700" -"constant.numeric" = "#d75f00" -"constant.character.escape" = { fg = "#8700af", modifiers = ["bold"]} -"operator" = { fg = "regular4", modifiers = ["bold"]} +"markup.link.label" = { fg = "regular2", modifiers = ["bold"] } +"markup.quote" = "regular4" +# Both inline and block code +"markup.raw" = "regular3" -"label" = { fg = "selection_background", modifiers = ["bold", "italic"] } +"diff.plus" = { bg = "diffadd_bg", fg = "diffadd_fg" } +"diff.delta" = { bg = "diffchange_bg" } +"diff.delta.moved" = { modifiers = ["italic"] } +"diff.minus" = { bg = "diffdelete_bg", fg = "diffdelete_fg" } -"diff.plus" = "regular2" -"diff.delta" = "bright0" -"diff.minus" = "bright1" - -"warning" = "bright4" -"error" = "regular1" -"info" = "#FFAF00" +[palette] +background = "#eeeeee" +foreground = "#444444" +regular0 = "#eeeeee" # color00 "Background" +regular1 = "#af0000" # color01 "Negative" +regular2 = "#008700" # color02 "Positive" +regular3 = "#5f8700" # color03 "Olve" +regular4 = "#0087af" # color04 "Neutral" / Aqua +regular5 = "#878787" # color05 "Comment" +regular6 = "#005f87" # color06 "Navy" +regular7 = "#444444" # color07 "Foreground" +bright0 = "#bcbcbc" # color08 "Nontext" +bright1 = "#d70000" # color09 "Red" +bright2 = "#d70087" # color10 "Pink" +bright3 = "#8700af" # color11 "Purple" +bright4 = "#d75f00" # color12 "Accent" +bright5 = "#d75f00" # color13 "Orange" +bright6 = "#005faf" # color14 "Blue" +bright7 = "#005f87" # color15 "Highlight" -"diagnostic.warning".underline = { color = "bright4", style = "curl" } -"diagnostic.error".underline = { color = "regular1", style = "curl" } -"diagnostic.info".underline = { color = "#FFAF00", style = "curl" } -"diagnostic.hint".underline = { color = "#FFAF00", style = "curl" } +selection_fg = "#eeeeee" +selection_bg = "#0087af" +selection_secondary_fg = "#d9d7d7" +selection_secondary_bg = "#2c687a" +special = "#3e999f" +cursorline_bg = "#e4e4e4" +cursorline_secondary_bg = "#eaeaea" +cursorcolumn_bg = "#e4e4e4" +cursorcolumn_secondary_bg = "#eaeaea" +cursorlinenr_fg = "#af5f00" +popupmenu_fg = "#444444" +popupmenu_bg = "#d0d0d0" +linenumber_fg = "#b2b2b2" +vertsplit_fg = "#005f87" +statusline_active_fg = "#e4e4e4" +statusline_active_bg = "#005f87" +statusline_inactive_fg = "#444444" +statusline_inactive_bg = "#d0d0d0" +todo_fg = "#00af5f" +error_fg = "#af0000" +error_bg = "#ffd7ff" +matchparen_bg = "#c6c6c6" +matchparen_fg = "#005f87" +wildmenu_fg = "#444444" +wildmenu_bg = "#ffff00" +diffadd_fg = "#008700" +diffadd_bg = "#afffaf" +diffdelete_fg = "#af0000" +diffdelete_bg = "#ffd7ff" +diffchange_bg = "#ffd787" -[palette] -background="#eeeeee" -foreground="#444444" -regular0="#eeeeee" -regular1="#af0000" -regular2="#008700" -regular3="#5f8700" -regular4="#0087af" -regular5="#878787" -regular6="#005f87" -regular7="#764e37" -bright0="#bcbcbc" -bright1="#d70000" -bright2="#d70087" -bright3="#8700af" -bright4="#d75f00" -bright5="#d75f00" -bright6="#4c7a5d" -bright7="#005faf" -selection_foreground="#eeeeee" -selection_background="#0087af" -cursorline_background="#fdfdfd" -paper_bar_bg="#005F87" -black="#eeeeee" -red="#d70000" -green="#008700" -yellow="#5f8700" -blue="#0087af" -magenta="#878787" -cyan="#005f87" -gray="#764e37" -light-red="#d70000" -light-green="#d70087" -light-yellow="#8700af" -light-blue="#d75f00" -light-magenta="#d75f00" -light-cyan="#4c7a4d" -light-gray="#005faf" -white="#444444" -linenr_fg_selected="#AF634D" +# 16 bit ANSI color names +black = "#eeeeee" +red = "#d70000" +green = "#008700" +yellow = "#5f8700" +blue = "#0087af" +magenta = "#878787" +cyan = "#005f87" +white = "#444444" +light-black = "#bcbcbc" +light-red = "#d70000" +light-green = "#d70087" +light-yellow = "#8700af" +light-blue = "#d75f00" +light-magenta = "#d75f00" +light-cyan = "#4c7a4d" +light-white = "#005faf" From e41bee6ac63095a3cd74c3efba0a417d8834f0b8 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 13 Sep 2023 15:38:14 -0700 Subject: [PATCH 003/213] [theme] Fix zenburn theme inlay hint color (#8278) --- runtime/themes/zenburn.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/themes/zenburn.toml b/runtime/themes/zenburn.toml index 8518e78f8390..9a4a7abccf6a 100644 --- a/runtime/themes/zenburn.toml +++ b/runtime/themes/zenburn.toml @@ -9,7 +9,7 @@ "ui.selection" = { bg = "#304a3d" } "ui.selection.primary" = { bg = "#2f2f2f" } "comment" = { fg = "comment" } -"ui.virtual.inlay-hint" = { fg = "comment" } +"ui.virtual.inlay-hint" = { fg = "#9f9f9f" } "comment.block.documentation" = { fg = "black", modifiers = ["bold"] } "ui.statusline" = { bg = "statusbg", fg = "#ccdc90" } "ui.statusline.inactive" = { fg = '#2e3330', bg = '#88b090' } From e9d0bd7aefda6962b56245eb7d0f56b5d2fa4859 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 12 Sep 2023 21:11:07 +0200 Subject: [PATCH 004/213] fix crash in picker preview for invalid ranges --- helix-term/src/ui/picker.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 94a69b0d3805..7e745f7241fb 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -112,9 +112,9 @@ impl Preview<'_, '_> { /// Alternate text to show for the preview. fn placeholder(&self) -> &str { match *self { - Self::EditorDocument(_) => "", + Self::EditorDocument(_) => "", Self::Cached(preview) => match preview { - CachedPreview::Document(_) => "", + CachedPreview::Document(_) => "", CachedPreview::Binary => "", CachedPreview::LargeFile => "", CachedPreview::NotFound => "", @@ -693,8 +693,14 @@ impl Picker { if let Some((path, range)) = self.current_file(cx.editor) { let preview = self.get_preview(path, cx.editor); let doc = match preview.document() { - Some(doc) => doc, - None => { + Some(doc) + if range.map_or(true, |(start, end)| { + start <= end && end <= doc.text().len_lines() + }) => + { + doc + } + _ => { let alt_text = preview.placeholder(); let x = inner.x + inner.width.saturating_sub(alt_text.len() as u16) / 2; let y = inner.y + inner.height / 2; From 13d4463e4146473391e37b7f75e99b731aa55878 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 12 Sep 2023 21:12:36 +0200 Subject: [PATCH 005/213] correctly center items in picker preview --- helix-term/src/ui/picker.rs | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 7e745f7241fb..2c41fc12d685 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -710,18 +710,30 @@ impl Picker { }; let mut offset = ViewPosition::default(); - if let Some(range) = range { - let text_fmt = doc.text_format(inner.width, None); - let annotations = TextAnnotations::default(); - (offset.anchor, offset.vertical_offset) = char_idx_at_visual_offset( - doc.text().slice(..), - doc.text().line_to_char(range.0), - // align to middle - -(inner.height as isize / 2), - 0, - &text_fmt, - &annotations, - ); + if let Some((start_line, end_line)) = range { + let height = end_line - start_line; + let text = doc.text().slice(..); + let start = text.line_to_char(start_line); + let middle = text.line_to_char(start_line + height / 2); + if height < inner.height as usize { + let text_fmt = doc.text_format(inner.width, None); + let annotations = TextAnnotations::default(); + (offset.anchor, offset.vertical_offset) = char_idx_at_visual_offset( + text, + middle, + // align to middle + -(inner.height as isize / 2), + 0, + &text_fmt, + &annotations, + ); + if start < offset.anchor { + offset.anchor = start; + offset.vertical_offset = 0; + } + } else { + offset.anchor = start; + } } let mut highlights = EditorView::doc_syntax_highlights( 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 006/213] 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 000000000000..2114054d0f56 --- /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 007/213] 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 c1b0acfdbd69..9d036b73cd04 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 37d2e94cf602..a6ff9c676eda 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 000000000000..46cefcbabc3a --- /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 000000000000..2f0e58eb6431 --- /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 000000000000..4465c87686a6 --- /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 008/213] 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 a6ff9c676eda..543c3dcc5e3d 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 009/213] 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 1da63ce08d57..03a6dc368498 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 010/213] 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 03a6dc368498..9804b75be684 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 011/213] 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 543c3dcc5e3d..78d7f6e9d8df 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 012/213] add .babelrc highlighting (#8309) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 78d7f6e9d8df..387aee6af671 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 013/213] 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 9d036b73cd04..f65f268d0559 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 387aee6af671..b0fc6344ddf0 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 ef073eb25523..bbfdf16e7532 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 ef073eb25523..321c90add371 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 ef073eb25523..ad67fe43f5a1 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 000000000000..5f8eaff7377e --- /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 014/213] 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 8ec2b6ff2b1e..956dc5824eeb 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 + +;; 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) -(term_definition) @variable +(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 015/213] 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 d2a700a85df5..867083dc48d5 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 5c7fd0dea725..65e9743ea4e4 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 016/213] 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 867083dc48d5..bccc33e07632 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 515443e03753..912342438700 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 65e9743ea4e4..878dcd1f9f1e 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 017/213] 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 bccc33e07632..0546a7bf09e9 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 018/213] 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 0546a7bf09e9..eba11ac95204 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 019/213] 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 bbfdf16e7532..86deb48f6325 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 020/213] 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 96d7c0ecac48..661210765fb6 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 a332a8a324cc..397dff4f4782 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 021/213] 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 b0fc6344ddf0..965da6ddebd1 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 022/213] 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 965da6ddebd1..081b36e2036d 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 023/213] 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 f1b310db441e..08f23b3e17e0 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 844286f84546..25d5c3b1a34f 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 024/213] 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 081b36e2036d..7b249fc6e7d2 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 025/213] 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 1433381d59bc..3c8a9868513e 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 026/213] 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 eba11ac95204..f2e65f8069b3 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 027/213] 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 f2e65f8069b3..c244b1d0bfea 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 028/213] 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 c244b1d0bfea..02bdd57b00ef 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 029/213] 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 3c8a9868513e..4d0c0d4a5aa6 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 030/213] 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 b2d81e45d4e7..b45a11bee2e2 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 031/213] Filter out language servers which fail to spawn (#8374) --- helix-lsp/src/lib.rs | 40 +++++++++-------- helix-view/src/editor.rs | 95 ++++++++++++++++++++++------------------ 2 files changed, 74 insertions(+), 61 deletions(-) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index d29a21440d39..a4be923b2f89 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 2265633dfced..7af28ccc680a 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(); - - // 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, |ls| ls.id() != doc_ls.id()) - }); + if language_servers.is_empty() { + return; + } - for (_, language_server) in doc_language_servers_not_in_registry { - tokio::spawn(language_server.text_document_did_close(doc.identifier())); - } + let language_id = doc.language_id().map(ToOwned::to_owned).unwrap_or_default(); - 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(), - )); - } + 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 + .get(*name) + .map_or(true, |doc_ls| ls.id() != doc_ls.id()) + }); - doc.language_servers = language_servers; + 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(), + )); } - Some(()) + + 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 032/213] 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 7b249fc6e7d2..c12c4e82df23 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 033/213] 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 21101ea75031..1db2aff862aa 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" } From 77fe8f214b15b8297a9f2f8ed929994559604d6c Mon Sep 17 00:00:00 2001 From: boofexxx <86674880+boofexxx@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:29:02 +0500 Subject: [PATCH 034/213] refine darcula and darcula-solid themes (#8412) --- runtime/themes/darcula-solid.toml | 5 +---- runtime/themes/darcula.toml | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/runtime/themes/darcula-solid.toml b/runtime/themes/darcula-solid.toml index 5feac234eea9..c867583d976b 100644 --- a/runtime/themes/darcula-solid.toml +++ b/runtime/themes/darcula-solid.toml @@ -4,9 +4,8 @@ inherits = "darcula" "ui.background.separator" = { bg = "grey01" } "ui.menu.scroll" = { fg = "grey02", bg = "grey00" } -"ui.popup" = { fg = "grey03", bg = "grey02" } +"ui.popup" = { fg = "grey05", bg = "grey00" } "ui.window" = { bg = "grey00" } -"ui.selection" = { bg = "blue" } "ui.cursorline.secondary" = { bg = "grey03" } [palette] @@ -15,5 +14,3 @@ grey01 = "#1f1f1f" grey02 = "#323232" grey03 = "#555555" grey04 = "#a8a8a8" - -blue = "#104158" diff --git a/runtime/themes/darcula.toml b/runtime/themes/darcula.toml index 53a271bd23bc..3086b727f1db 100644 --- a/runtime/themes/darcula.toml +++ b/runtime/themes/darcula.toml @@ -8,7 +8,8 @@ "ui.gutter" = { bg = "grey01" } "ui.popup" = { fg = "grey05", bg = "grey00" } "ui.window" = { bg = "grey01" } -"ui.selection" = { bg = "grey03" } +"ui.selection" = { bg = "grey02" } +"ui.selection.primary" = { bg = "blue" } "ui.statusline" = { fg = "grey04", bg = "grey02" } "ui.statusline.insert" = { bg = "white", fg = "grey01" } "ui.statusline.select" = { bg = "orange", fg = "grey01" } @@ -61,7 +62,7 @@ "markup.link.url" = { fg = "lightblue", modifiers = ["underlined"] } "markup.link.text" = "white" "markup.quote" = "darkgreen" -"markup.raw" = "white" +"markup.raw" = "purple" "diff.plus" = "green" "diff.delta" = "grey" @@ -97,3 +98,4 @@ green = "#32cd32" grey = "#808080" darkgreen = "#629755" lightblue = "#6897bb" +blue = "#104158" From 1297d924e7480fdd2a77c792c06042770856fa3e Mon Sep 17 00:00:00 2001 From: Jonah Lund <126015019+JonahLund@users.noreply.github.com> Date: Fri, 29 Sep 2023 21:19:57 +0200 Subject: [PATCH 035/213] improve nord theme (#8414) --- runtime/themes/nord.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/themes/nord.toml b/runtime/themes/nord.toml index e1e63b323b8a..bc78db71dc6d 100644 --- a/runtime/themes/nord.toml +++ b/runtime/themes/nord.toml @@ -50,7 +50,7 @@ "keyword.operator" = "nord9" "keyword.return" = "nord9" "keyword.storage.modifier" = "nord9" -"keyword.storage.type" = "nord7" +"keyword.storage.type" = "nord9" # Punctuation "punctuation" = "nord6" @@ -65,22 +65,22 @@ "string.special" = "nord13" # Types -"type" = "nord4" +"type" = "nord7" "type.builtin" = "nord7" # Variables "variable" = "nord4" -"variable.builint" = "nord9" +"variable.builtin" = "nord9" "variable.other.member" = "nord4" "variable.parameter" = "nord8" -"attribute" = "nord4" +"attribute" = "nord9" # Misc. "label" = "nord7" "namespace" = "nord4" "operator" = "nord9" -"special" = "nord4" -"tag" = "nord4" +"special" = "nord9" +"tag" = "nord7" "comment" = { fg = "nord3_bright", modifiers = ["italic"] } ## EDITOR UI COLORS @@ -165,7 +165,7 @@ nord8 = "#88C0D0" # A more darkened and less saturated color reminiscent of arctic waters nord9 = "#81A1C1" # A dark and intensive color reminiscent of the deep arctic ocean - nord10 = "#5E81AC" +nord10 = "#5E81AC" # Aurora consists of five colorful components reminiscent of the "Aurora borealis", sometimes referred to as polar lights or northern lights. # From 4e86d1c35adbb7c158b2d262e4c129c2bee41a0a Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Sat, 30 Sep 2023 05:28:25 +0200 Subject: [PATCH 036/213] fix multicursor snippet placeholder directions (#8423) --- helix-lsp/src/lib.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index a4be923b2f89..b6a990659aaa 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -445,36 +445,36 @@ pub mod util { // the tabstop closest to the range simply replaces `head` while anchor remains in place // the remaining tabstops receive their own single-width cursor if range.head < range.anchor { - let first_tabstop = tabstop_anchor + tabstops[0].1; + let last_idx = tabstops.len() - 1; + let last_tabstop = tabstop_anchor + tabstops[last_idx].0; // if selection is forward but was moved to the right it is // contained entirely in the replacement text, just do a point // selection (fallback below) - if range.anchor >= first_tabstop { - let range = Range::new(range.anchor, first_tabstop); + if range.anchor > last_tabstop { + let range = Range::new(range.anchor, last_tabstop); mapped_selection.push(range); - let rem_tabstops = tabstops[1..] + let rem_tabstops = tabstops[..last_idx] .iter() - .map(|tabstop| Range::point(tabstop_anchor + tabstop.1)); + .map(|tabstop| Range::point(tabstop_anchor + tabstop.0)); mapped_selection.extend(rem_tabstops); continue; } } else { - let last_idx = tabstops.len() - 1; - let last_tabstop = tabstop_anchor + tabstops[last_idx].1; + let first_tabstop = tabstop_anchor + tabstops[0].0; // if selection is forward but was moved to the right it is // contained entirely in the replacement text, just do a point // selection (fallback below) - if range.anchor <= last_tabstop { + if range.anchor < first_tabstop { // we can't properly compute the the next grapheme // here because the transaction hasn't been applied yet // that is not a problem because the range gets grapheme aligned anyway // tough so just adding one will always cause head to be grapheme // aligned correctly when applied to the document - let range = Range::new(range.anchor, last_tabstop + 1); + let range = Range::new(range.anchor, first_tabstop + 1); mapped_selection.push(range); - let rem_tabstops = tabstops[..last_idx] + let rem_tabstops = tabstops[1..] .iter() .map(|tabstop| Range::point(tabstop_anchor + tabstop.0)); mapped_selection.extend(rem_tabstops); From 893802d5a2155f6a14a7f55265614779f20006a2 Mon Sep 17 00:00:00 2001 From: Yoav Lavi Date: Mon, 2 Oct 2023 01:40:47 +0300 Subject: [PATCH 037/213] Add VSCode file associations (#8388) * Add VSCode file associations * Update languages.toml Co-authored-by: Robert Clover * Change cpp *.in files to suffixes --------- Co-authored-by: Robert Clover --- languages.toml | 191 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 172 insertions(+), 19 deletions(-) diff --git a/languages.toml b/languages.toml index c12c4e82df23..e933083434a1 100644 --- a/languages.toml +++ b/languages.toml @@ -317,7 +317,27 @@ indent = { tab-width = 2, unit = " " } name = "json" scope = "source.json" injection-regex = "json" -file-types = ["json", "jsonc", "arb", "ipynb", "geojson", "gltf", "webmanifest", "flake.lock", ".babelrc"] +file-types = [ + "json", + "jsonc", + "arb", + "ipynb", + "geojson", + "gltf", + "webmanifest", + "flake.lock", + ".babelrc", + ".bowerrc", + ".jscrc", + "js.map", + "ts.map", + "css.map", + ".jslintrc", + "jsonld", + ".vuerc", + "composer.lock", + ".watchmanconfig" +] roots = [] language-servers = [ "vscode-json-language-server" ] auto-format = true @@ -368,7 +388,7 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-c", rev = "7175a6dd 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"] +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" ] @@ -415,7 +435,7 @@ language-servers = [ "crystalline" ] name = "c-sharp" scope = "source.csharp" injection-regex = "c-?sharp" -file-types = ["cs"] +file-types = ["cs", "csx", "cake"] roots = ["sln", "csproj"] comment-token = "//" indent = { tab-width = 4, unit = "\t" } @@ -546,7 +566,7 @@ name = "javascript" scope = "source.js" injection-regex = "(js|javascript)" language-id = "javascript" -file-types = ["js", "mjs", "cjs", "rules"] +file-types = ["js", "mjs", "cjs", "rules", "es6", "pac", "jakefile"] shebangs = ["node"] roots = [] comment-token = "//" @@ -642,7 +662,7 @@ source = { git = "https://github.com/serenadeai/tree-sitter-scss", rev = "c478c6 name = "html" scope = "text.html.basic" injection-regex = "html" -file-types = ["html"] +file-types = ["html", "htm", "shtml", "xhtml", "xht", "jsp", "asp", "aspx", "jshtm", "volt", "rhtml"] roots = [] language-servers = [ "vscode-html-language-server" ] auto-format = true @@ -656,7 +676,7 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-html", rev = "29f53 name = "python" scope = "source.python" injection-regex = "python" -file-types = ["py","pyi","py3","pyw","ptl",".pythonstartup",".pythonrc","SConstruct"] +file-types = ["py","pyi","py3","pyw","ptl",".pythonstartup",".pythonrc","SConstruct", "rpy", "cpy", "ipy", "pyt", "SConscript"] shebangs = ["python"] roots = ["pyproject.toml", "setup.py", "poetry.lock", "pyrightconfig.json"] comment-token = "#" @@ -708,7 +728,42 @@ source = { git = "https://github.com/nix-community/tree-sitter-nix", rev = "1b69 name = "ruby" scope = "source.ruby" injection-regex = "ruby" -file-types = ["rb", "rake", "rakefile", "irb", "gemfile", "gemspec", "Rakefile", "Gemfile", "rabl", "jbuilder", "jb", "Podfile", "podspec", "Vagrantfile", "Brewfile"] +file-types = [ + "rb", + "rake", + "rakefile", + "irb", + "gemfile", + "gemspec", + "Rakefile", + "Gemfile", + "rabl", + "jbuilder", + "jb", + "Podfile", + "podspec", + "Vagrantfile", + "Brewfile", + "rjs", + "rbi", + "Guardfile", + "Capfile", + "Cheffile", + "Hobofile", + "Appraisals", + "Rantfile", + "Berksfile", + "Berksfile.lock", + "Thorfile", + "Puppetfile", + "Fastfile", + "Appfile", + "Deliverfile", + "Matchfile", + "Scanfile", + "Snapfile", + "Gymfile" +] shebangs = ["ruby"] roots = [] comment-token = "#" @@ -723,7 +778,47 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-ruby", rev = "206c7 name = "bash" scope = "source.bash" injection-regex = "(shell|bash|zsh|sh)" -file-types = ["sh", "bash", "zsh", ".bash_login", ".bash_logout", ".bash_profile", ".bashrc", ".profile", ".zshenv", "zshenv", ".zlogin", "zlogin", ".zlogout", "zlogout", ".zprofile", "zprofile", ".zshrc", "zshrc", ".zimrc", "APKBUILD", "PKGBUILD", "eclass", "ebuild", "bazelrc", ".bash_aliases", "Renviron", ".Renviron"] +file-types = [ + "sh", + "bash", + "zsh", + ".bash_login", + ".bash_logout", + ".bash_profile", + ".bashrc", + ".profile", + ".zshenv", + "zshenv", + ".zlogin", + "zlogin", + ".zlogout", + "zlogout", + ".zprofile", + "zprofile", + ".zshrc", + "zshrc", + ".zimrc", + "APKBUILD", + "PKGBUILD", + "eclass", + "ebuild", + "bazelrc", + ".bash_aliases", + "Renviron", + ".Renviron", + ".xprofile", + ".xsession", + ".xsessionrc", + "zsh-theme", + "ksh", + "cshrc", + "tcshrc", + ".yashrc", + ".yash_profile", + ".hushlogin", + "bashrc_Apple_Terminal", + "zshrc_Apple_Terminal" +] shebangs = ["sh", "bash", "dash", "zsh"] roots = [] comment-token = "#" @@ -738,7 +833,7 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "275ef name = "php" scope = "source.php" injection-regex = "php" -file-types = ["php", "inc"] +file-types = ["php", "inc", "php4", "php5", "phtml", "ctp"] shebangs = ["php"] roots = ["composer.json", "index.php"] language-servers = [ "intelephense" ] @@ -764,7 +859,7 @@ source = { git = "https://github.com/gbprod/tree-sitter-twig", rev = "807b293fec name = "latex" scope = "source.tex" injection-regex = "tex" -file-types = ["tex", "sty", "cls", "Rd"] +file-types = ["tex", "sty", "cls", "Rd", "bbx", "cbx"] roots = [] comment-token = "%" language-servers = [ "texlab" ] @@ -1086,7 +1181,7 @@ source = { git = "https://github.com/uyha/tree-sitter-cmake", rev = "6e51463ef30 [[language]] name = "make" scope = "source.make" -file-types = ["Makefile", "makefile", "make", "mk"] +file-types = ["Makefile", "makefile", "make", "mk", "mak", "GNUmakefile", "OCamlMakefile"] shebangs = ["make", "gmake"] injection-regex = "(make|makefile|Makefile|mk)" roots = [] @@ -1113,7 +1208,7 @@ source = { git = "https://github.com/theHamsta/tree-sitter-glsl", rev = "88408ff [[language]] name = "perl" scope = "source.perl" -file-types = ["pl", "pm", "t"] +file-types = ["pl", "pm", "t", "psgi", "raku", "rakumod", "rakutest", "rakudoc", "nqp", "p6", "pl6", "pm6"] shebangs = ["perl"] roots = [] comment-token = "#" @@ -1240,7 +1335,7 @@ source = { git = "https://github.com/Flakebi/tree-sitter-tablegen", rev = "568dd name = "markdown" scope = "source.md" injection-regex = "md|markdown" -file-types = ["md", "markdown", "PULLREQ_EDITMSG"] +file-types = ["md", "markdown", "PULLREQ_EDITMSG", "mkd", "mdwn", "mdown", "markdn", "mdtxt", "mdtext", "workbook"] roots = [".marksman.toml"] language-servers = [ "marksman" ] indent = { tab-width = 2, unit = " " } @@ -1320,7 +1415,7 @@ source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev name = "diff" scope = "source.diff" roots = [] -file-types = ["diff", "patch"] +file-types = ["diff", "patch", "rej"] injection-regex = "diff" comment-token = "#" indent = { tab-width = 2, unit = " " } @@ -1578,7 +1673,7 @@ source = { git = "https://github.com/Hubro/tree-sitter-robot", rev = "322e4cc657 name = "r" scope = "source.r" injection-regex = "(r|R)" -file-types = ["r", "R", ".Rprofile", "Rprofile.site"] +file-types = ["r", "R", ".Rprofile", "Rprofile.site", ".RHistory"] shebangs = ["r", "R"] roots = [] comment-token = "#" @@ -1663,7 +1758,7 @@ source = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = " [[language]] name = "sql" scope = "source.sql" -file-types = ["sql"] +file-types = ["sql", "dsql"] roots = [] comment-token = "--" indent = { tab-width = 4, unit = " " } @@ -2206,7 +2301,62 @@ 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", "policy"] +file-types = [ + "xml", + "mobileconfig", + "plist", + "xib", + "storyboard", + "svg", + "xsd", + "gml", + "xaml", + "gir", + "rss", + "atom", + "opml", + "policy", + "ascx", + "axml", + "axaml", + "bpmn", + "cpt", + "csl", + "csproj.user", + "dita", + "ditamap", + "dtml", + "fxml", + "iml", + "isml", + "jmx", + "launch", + "menu", + "mxml", + "nuspec", + "pt", + "publishsettings", + "pubxml", + "pubxml.user", + "rbxlx", + "rbxmx", + "rng", + "shproj", + "tld", + "tmx", + "vbproj.user", + "vcxproj", + "vcxproj.filters", + "wsdl", + "wxi", + "wxs", + "xbl", + "xlf", + "xliff", + "xpdl", + "xul", + "xoml" +] indent = { tab-width = 2, unit = " " } roots = [] @@ -2295,7 +2445,10 @@ file-types = [ "volume", "kube", "network", - ".editorconfig" + ".editorconfig", + "properties", + "cfg", + "directory" ] injection-regex = "ini" comment-token = "#" @@ -2704,7 +2857,7 @@ name = "fsharp" scope = "source.fs" roots = ["sln", "fsproj"] injection-regex = "fsharp" -file-types = ["fs", "fsx"] +file-types = ["fs", "fsx", "fsi", "fsscript"] comment-token = "//" indent = { tab-width = 4, unit = " " } auto-format = true From 0e13db28327d69e97907d27bc5364629637a6c8e Mon Sep 17 00:00:00 2001 From: David Else <12832280+David-Else@users.noreply.github.com> Date: Sun, 1 Oct 2023 23:41:54 +0100 Subject: [PATCH 038/213] Add validation to CSS and JSON language servers (#8433) --- languages.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index e933083434a1..af1466f1b3ce 100644 --- a/languages.toml +++ b/languages.toml @@ -77,9 +77,9 @@ texlab = { command = "texlab" } vala-language-server = { command = "vala-language-server" } vhdl_ls = { command = "vhdl_ls", args = [] } vlang-language-server = { command = "v-analyzer" } -vscode-css-language-server = { command = "vscode-css-language-server", args = ["--stdio"], config = { "provideFormatter" = true }} +vscode-css-language-server = { command = "vscode-css-language-server", args = ["--stdio"], config = { provideFormatter = true, css = { validate = { enable = true } } } } vscode-html-language-server = { command = "vscode-html-language-server", args = ["--stdio"], config = { provideFormatter = true } } -vscode-json-language-server = { command = "vscode-json-language-server", args = ["--stdio"], config = { provideFormatter = true } } +vscode-json-language-server = { command = "vscode-json-language-server", args = ["--stdio"], config = { provideFormatter = true, json = { validate = { enable = true } } } } vuels = { command = "vue-language-server", args = ["--stdio"], config = { typescript = { tsdk = "node_modules/typescript/lib/" } } } wgsl_analyzer = { command = "wgsl_analyzer" } yaml-language-server = { command = "yaml-language-server", args = ["--stdio"] } From 6abaf3d24f47b9537766e9a8ffe1d76a4329d1f2 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sun, 1 Oct 2023 22:32:27 -0500 Subject: [PATCH 039/213] LSP: Fix codeAction/resolve server capability check (#8421) Previously we accidentally checked the server's _completion_ resolve capability rather than the code action resolve capability. --- helix-lsp/src/client.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index ed9a2f830e4f..341702c374ce 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -971,12 +971,12 @@ impl Client { ) -> Option>> { let capabilities = self.capabilities.get().unwrap(); - // Return early if the server does not support resolving code action. - match capabilities.completion_provider { - Some(lsp::CompletionOptions { + // Return early if the server does not support resolving code actions. + match capabilities.code_action_provider { + Some(lsp::CodeActionProviderCapability::Options(lsp::CodeActionOptions { resolve_provider: Some(true), .. - }) => (), + })) => (), _ => return None, } From 7fbfec766c2ce2570ca4160744723813dbdc3019 Mon Sep 17 00:00:00 2001 From: Mathis Brossier Date: Mon, 2 Oct 2023 16:10:29 +0200 Subject: [PATCH 040/213] book: Fix broken link (#8441) --- book/src/guides/injection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/src/guides/injection.md b/book/src/guides/injection.md index 18c474cfe731..e842ae303ffc 100644 --- a/book/src/guides/injection.md +++ b/book/src/guides/injection.md @@ -1,7 +1,7 @@ # Adding Injection Queries Writing language injection queries allows one to highlight a specific node as a different language. -In addition to the [standard](upstream-docs) language injection options used by tree-sitter, there +In addition to the [standard][upstream-docs] language injection options used by tree-sitter, there are a few Helix specific extensions that allow for more control. And example of a simple query that would highlight all strings as bash in Nix: From 588363c2c17f3f70d0c06739d84eb5f6f18c3a25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:16:00 +0900 Subject: [PATCH 041/213] build(deps): bump regex from 1.9.5 to 1.9.6 (#8451) Bumps [regex](https://github.com/rust-lang/regex) from 1.9.5 to 1.9.6. - [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.5...1.9.6) --- updated-dependencies: - dependency-name: regex 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 02bdd57b00ef..8426583c4f91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1987,9 +1987,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick 1.0.2", "memchr", @@ -1999,9 +1999,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick 1.0.2", "memchr", From 7dddbca558e14a42c1f947e67b463e2c2b5647c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:16:30 +0900 Subject: [PATCH 042/213] build(deps): bump rustix from 0.38.14 to 0.38.15 (#8449) Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.14 to 0.38.15. - [Release notes](https://github.com/bytecodealliance/rustix/releases) - [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.14...v0.38.15) --- 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8426583c4f91..16f89f8f17c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1455,7 +1455,7 @@ dependencies = [ "log", "once_cell", "parking_lot", - "rustix 0.38.14", + "rustix 0.38.15", "serde", "serde_json", "slotmap", @@ -2052,9 +2052,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.14" +version = "0.38.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" +checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" dependencies = [ "bitflags 2.4.0", "errno", @@ -2289,7 +2289,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.38.14", + "rustix 0.38.15", "windows-sys 0.48.0", ] @@ -2646,7 +2646,7 @@ dependencies = [ "dirs", "either", "once_cell", - "rustix 0.38.14", + "rustix 0.38.15", ] [[package]] From a42b5f011e212bfb6106deddcb1b99dc584453e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:16:51 +0900 Subject: [PATCH 043/213] build(deps): bump libloading from 0.8.0 to 0.8.1 (#8448) Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.8.0 to 0.8.1. - [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.0...0.8.1) --- updated-dependencies: - dependency-name: libloading 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 16f89f8f17c1..d22a689e6c81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1632,9 +1632,9 @@ checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", "windows-sys 0.48.0", From e122add561ebe310f6976b447f0a3d984e0de5d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:17:03 +0900 Subject: [PATCH 044/213] build(deps): bump thiserror from 1.0.48 to 1.0.49 (#8447) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror 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 d22a689e6c81..ee09c8e0c336 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2324,18 +2324,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", From 1756ba443631b0eb6d93c089d3b13b13cd8ef28f Mon Sep 17 00:00:00 2001 From: Gabriel Dinner-David <82682503+gabydd@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:17:32 -0400 Subject: [PATCH 045/213] update with new mdbook index.hbs (#8445) --- book/theme/index.hbs | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/book/theme/index.hbs b/book/theme/index.hbs index ed27410f6437..0a0bc55019cb 100644 --- a/book/theme/index.hbs +++ b/book/theme/index.hbs @@ -1,11 +1,11 @@ - + {{ title }} {{#if is_print }} - + {{/if}} {{#if base_url}} @@ -17,7 +17,7 @@ - + {{#if favicon_svg}} @@ -34,8 +34,6 @@ - - {{#if copy_fonts}} {{/if}} @@ -55,7 +53,7 @@ {{/if}} - +
    + +