From 2f82bc13e87ded654f933d1751063da889bac7c7 Mon Sep 17 00:00:00 2001 From: EsfoNL <59415349+EsfoNL@users.noreply.github.com> Date: Wed, 12 Apr 2023 00:59:08 +0200 Subject: [PATCH 01/44] Fix crash on opening jumplist (#6672) Co-authored-by: Esra Fokker --- helix-term/src/commands.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 17669924cf02..95310c1fec71 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2547,6 +2547,13 @@ fn jumplist_picker(cx: &mut Context) { } } + for (view, _) in cx.editor.tree.views_mut() { + for doc_id in view.jumps.iter().map(|e| e.0).collect::>().iter() { + let doc = doc_mut!(cx.editor, doc_id); + view.sync_changes(doc); + } + } + let new_meta = |view: &View, doc_id: DocumentId, selection: Selection| { let doc = &cx.editor.documents.get(&doc_id); let text = doc.map_or("".into(), |d| { From d5fec302c9fc6a6e334a0d518c6d10f7dbeb26a7 Mon Sep 17 00:00:00 2001 From: Constantin Angheloiu Date: Wed, 12 Apr 2023 04:02:14 +0300 Subject: [PATCH 02/44] base16_transparent: Highlight selected item state (#6716) Increase visibility of selected file in file picker https://asciinema.org/a/DBaZ5zjaYrKlXDSAVH8THVZg4 --- runtime/themes/base16_transparent.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/themes/base16_transparent.toml b/runtime/themes/base16_transparent.toml index 63aa1f869c8b..c314ae8c516e 100644 --- a/runtime/themes/base16_transparent.toml +++ b/runtime/themes/base16_transparent.toml @@ -3,6 +3,8 @@ "ui.background" = { fg = "white"} "ui.background.separator" = { fg = "gray" } +"ui.text" = { fg = "light-gray" } +"ui.text.focus" = { fg = "white" } "ui.menu" = { fg = "white" } "ui.menu.selected" = { modifiers = ["reversed"] } "ui.menu.scroll" = { fg = "light-gray" } From 92c5f5f18cfafa8e9f6cb6cf0f6b584977af8eb2 Mon Sep 17 00:00:00 2001 From: Ollie Charles Date: Wed, 12 Apr 2023 14:38:11 +0100 Subject: [PATCH 03/44] Initial Cabal language support (#6485) --- book/src/generated/lang-support.md | 1 + languages.toml | 13 ++++++++++++- runtime/queries/cabal/highlights.scm | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/cabal/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 3f56dd606b32..28dfeb049120 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -9,6 +9,7 @@ | bicep | ✓ | | | `bicep-langserver` | | c | ✓ | ✓ | ✓ | `clangd` | | c-sharp | ✓ | ✓ | | `OmniSharp` | +| cabal | ✓ | | | | | cairo | ✓ | | | | | capnp | ✓ | | ✓ | | | clojure | ✓ | | | `clojure-lsp` | diff --git a/languages.toml b/languages.toml index 479777f9e239..e7c374992e41 100644 --- a/languages.toml +++ b/languages.toml @@ -2437,6 +2437,18 @@ language-server = { command = "nimlangserver" } name = "nim" source = { git = "https://github.com/aMOPel/tree-sitter-nim", rev = "240239b232550e431d67de250d1b5856209e7f06" } +[[language]] +name = "cabal" +scope = "source.cabal" +file-types = [ "cabal" ] +roots = ["cabal.project", "Setup.hs"] +indent = { tab-width = 2, unit = " " } +comment-token = "--" + +[[grammar]] +name = "cabal" +source = { git = "https://gitlab.com/magus/tree-sitter-cabal/", rev = "7d5fa6887ae05a0b06d046f1e754c197c8ad869b" } + [[language]] name = "hurl" scope = "source.hurl" @@ -2449,4 +2461,3 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "hurl" source = { git = "https://github.com/pfeiferj/tree-sitter-hurl", rev = "264c42064b61ee21abe88d0061f29a0523352e22" } - diff --git a/runtime/queries/cabal/highlights.scm b/runtime/queries/cabal/highlights.scm new file mode 100644 index 000000000000..d6b9f4627054 --- /dev/null +++ b/runtime/queries/cabal/highlights.scm @@ -0,0 +1,15 @@ +(comment) @comment + +[ + "cabal-version" + (field_name) +] @type + +(section_name) @type + +[ + (section_type) + "if" + "elseif" + "else" +] @keyword From 9248de87802131475eaf52acbc1e0c95e6a1097e Mon Sep 17 00:00:00 2001 From: basbebe Date: Tue, 7 Feb 2023 12:35:08 +0100 Subject: [PATCH 04/44] Adjust everforest to resemble original more closely Adjust palettes and assignments: Color palettes of upstream everforest where tweaked since creation of this port: - https://github.com/sainnhe/everforest/pull/108 - https://github.com/sainnhe/everforest/pull/109 These adjustments move the helix everforest theme closer to the dcocumented upstream vim theme --- runtime/themes/everforest_dark.toml | 121 +++++++++++++------------ runtime/themes/everforest_light.toml | 127 +++++++++++++++------------ 2 files changed, 140 insertions(+), 108 deletions(-) diff --git a/runtime/themes/everforest_dark.toml b/runtime/themes/everforest_dark.toml index 4947e4f3b41d..3dd9243f6049 100644 --- a/runtime/themes/everforest_dark.toml +++ b/runtime/themes/everforest_dark.toml @@ -1,81 +1,93 @@ -# Everforest (Dark Hard) -# Author: CptPotato +# Everforest (Dark Medium) +# Authors: CptPotato, basbebe # Original Author: # URL: https://github.com/sainnhe/everforest -# Filename: autoload/everforest.vim +# Filename: colors/everforest.vim # Author: sainnhe # Email: sainnhe@gmail.com # License: MIT License -"type" = "yellow" -"constant" = "purple" +"type" = { fg = "yellow", modifiers = ["italic"] } +"constant" = "fg" +"constant.builtin" = { fg = "purple", modifiers = ["italic"] } +"constant.builtin.boolean" = "purple" "constant.numeric" = "purple" -"constant.character.escape" = "orange" -"string" = "green" -"string.regexp" = "blue" -"comment" = "grey0" +"constant.character.escape" = "green" +"string" = "aqua" +"string.regexp" = "green" +"string.special" = "yellow" +"comment" = { fg = "grey1", modifiers = ["italic"] } "variable" = "fg" -"variable.builtin" = "blue" +"variable.builtin" = { fg = "purple", modifiers = ["italic"] } "variable.parameter" = "fg" -"variable.other.member" = "fg" -"label" = "aqua" +"variable.other.member" = "blue" +"label" = "orange" "punctuation" = "grey2" -"punctuation.delimiter" = "grey2" +"punctuation.delimiter" = "grey1" "punctuation.bracket" = "fg" +"punctuation.special" = "blue" "keyword" = "red" -"keyword.directive" = "aqua" +"keyword.operator" = "orange" +"keyword.directive" = "purple" +"keyword.storage" = "orange" "operator" = "orange" "function" = "green" -"function.builtin" = "blue" -"function.macro" = "aqua" -"tag" = "yellow" -"namespace" = "aqua" -"attribute" = "aqua" -"constructor" = "yellow" -"module" = "blue" -"special" = "orange" +"function.macro" = "green" +"tag" = "orange" +"namespace" = { fg = "yellow", modifiers = ["italic"] } +"attribute" = { fg = "purple", modifiers = ["italic"] } +"constructor" = "green" +"module" = "yellow" +"special" = "blue" -"markup.heading.marker" = "grey2" +"markup.heading.marker" = "grey1" "markup.heading.1" = { fg = "red", modifiers = ["bold"] } "markup.heading.2" = { fg = "orange", modifiers = ["bold"] } "markup.heading.3" = { fg = "yellow", modifiers = ["bold"] } "markup.heading.4" = { fg = "green", modifiers = ["bold"] } "markup.heading.5" = { fg = "blue", modifiers = ["bold"] } -"markup.heading.6" = { fg = "fg", modifiers = ["bold"] } +"markup.heading.6" = { fg = "purple", modifiers = ["bold"] } "markup.list" = "red" "markup.bold" = { modifiers = ["bold"] } "markup.italic" = { modifiers = ["italic"] } "markup.strikethrough" = { modifiers = ["crossed_out"] } -"markup.link.url" = { fg = "blue", modifiers = ["underlined"] } +"markup.link.url" = { fg = "blue", underline = { style = "line" } } +"markup.link.label" = "orange" "markup.link.text" = "purple" -"markup.quote" = "grey2" -"markup.raw" = "green" +"markup.quote" = "grey1" +"markup.raw.inline" = "green" +"markup.raw.block" = "aqua" "diff.plus" = "green" -"diff.delta" = "orange" +"diff.delta" = "blue" "diff.minus" = "red" "ui.background" = { bg = "bg0" } -"ui.background.separator" = "grey0" -"ui.cursor" = { fg = "bg0", bg = "fg" } -"ui.cursor.match" = { fg = "orange", bg = "bg_yellow" } +"ui.background.separator" = "bg_visual" +"ui.cursor" = { fg = "bg1", bg = "grey2" } "ui.cursor.insert" = { fg = "bg0", bg = "grey1" } "ui.cursor.select" = { fg = "bg0", bg = "blue" } +"ui.cursor.match" = { fg = "orange", bg = "bg_yellow" } +"ui.cursor.primary" = { fg = "bg0", bg = "fg" } "ui.cursorline.primary" = { bg = "bg1" } -"ui.cursorline.secondary" = { bg = "bg1" } +"ui.cursorline.secondary" = { bg = "bg2" } "ui.selection" = { bg = "bg3" } "ui.linenr" = "grey0" -"ui.linenr.selected" = "fg" +"ui.linenr.selected" = "grey2" "ui.statusline" = { fg = "grey2", bg = "bg3" } "ui.statusline.inactive" = { fg = "grey0", bg = "bg1" } -"ui.statusline.normal" = { fg = "bg0", bg = "grey2", modifiers = ["bold"] } -"ui.statusline.insert" = { fg = "bg0", bg = "yellow", modifiers = ["bold"] } +"ui.statusline.normal" = { fg = "bg0", bg = "statusline1", modifiers = [ + "bold", +] } +"ui.statusline.insert" = { fg = "bg0", bg = "statusline2", modifiers = [ + "bold", +] } "ui.statusline.select" = { fg = "bg0", bg = "blue", modifiers = ["bold"] } -"ui.bufferline" = { fg = "grey0", bg = "bg1" } -"ui.bufferline.active" = { fg = "fg", bg = "bg3", modifiers = ["bold"] } +"ui.bufferline" = { fg = "grey2", bg = "bg3" } +"ui.bufferline.active" = { fg = "bg0", bg = "statusline1", modifiers = ["bold"] } "ui.popup" = { fg = "grey2", bg = "bg2" } -"ui.window" = { fg = "grey0", bg = "bg0" } +"ui.window" = { fg = "bg4", bg = "bg_dim" } "ui.help" = { fg = "fg", bg = "bg2" } "ui.text" = "fg" "ui.text.focus" = "fg" @@ -85,30 +97,30 @@ "ui.virtual.indent-guide" = { fg = "bg4" } "ui.virtual.ruler" = { bg = "bg3" } -"hint" = "blue" -"info" = "aqua" +"hint" = "green" +"info" = "blue" "warning" = "yellow" "error" = "red" -"diagnostic.hint" = { underline = { color = "blue", style = "curl" } } -"diagnostic.info" = { underline = { color = "aqua", style = "curl" } } +"diagnostic.hint" = { underline = { color = "green", style = "curl" } } +"diagnostic.info" = { underline = { color = "blue", style = "curl" } } "diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } "diagnostic.error" = { underline = { color = "red", style = "curl" } } - [palette] -bg0 = "#2b3339" -bg1 = "#323c41" -bg2 = "#3a454a" -bg3 = "#445055" -bg4 = "#4c555b" -bg5 = "#53605c" -bg_visual = "#503946" -bg_red = "#4e3e43" -bg_green = "#404d44" -bg_blue = "#394f5a" -bg_yellow = "#4a4940" +bg_dim = "#232a2e" +bg0 = "#2d353b" +bg1 = "#343f44" +bg2 = "#3d484d" +bg3 = "#475258" +bg4 = "#4f585e" +bg5 = "#56635f" +bg_visual = "#543a48" +bg_red = "#514045" +bg_green = "#425047" +bg_blue = "#3a515d" +bg_yellow = "#4d4c43" fg = "#d3c6aa" red = "#e67e80" @@ -118,6 +130,7 @@ green = "#a7c080" aqua = "#83c092" blue = "#7fbbb3" purple = "#d699b6" + grey0 = "#7a8478" grey1 = "#859289" grey2 = "#9da9a0" diff --git a/runtime/themes/everforest_light.toml b/runtime/themes/everforest_light.toml index f9a55b0a8dcc..ef0544ac6594 100644 --- a/runtime/themes/everforest_light.toml +++ b/runtime/themes/everforest_light.toml @@ -1,81 +1,95 @@ -# Everforest (Dark Hard) -# Author: CptPotato +# Everforest (Light Medium) +# Authors: CptPotato, WindSoilder, basbebe # Original Author: # URL: https://github.com/sainnhe/everforest -# Filename: autoload/everforest.vim +# Filename: colors/everforest.vim # Author: sainnhe # Email: sainnhe@gmail.com # License: MIT License -"type" = "yellow" -"constant" = "purple" +"type" = { fg = "yellow", modifiers = ["italic"] } +"constant" = "fg" +"constant.builtin" = { fg = "purple", modifiers = ["italic"] } +"constant.builtin.boolean" = "purple" "constant.numeric" = "purple" -"constant.character.escape" = "orange" -"string" = "green" -"string.regexp" = "blue" -"comment" = "grey0" +"constant.character.escape" = "green" +"string" = "aqua" +"string.regexp" = "green" +"string.special" = "yellow" +"comment" = { fg = "grey1", modifiers = ["italic"] } "variable" = "fg" -"variable.builtin" = "blue" +"variable.builtin" = { fg = "purple", modifiers = ["italic"] } "variable.parameter" = "fg" -"variable.other.member" = "fg" -"label" = "aqua" +"variable.other.member" = "blue" +"label" = "orange" "punctuation" = "grey2" -"punctuation.delimiter" = "grey2" +"punctuation.delimiter" = "grey1" "punctuation.bracket" = "fg" +"punctuation.special" = "blue" "keyword" = "red" -"keyword.directive" = "aqua" +"keyword.operator" = "orange" +"keyword.directive" = "purple" +"keyword.storage" = "orange" "operator" = "orange" "function" = "green" -"function.builtin" = "blue" -"function.macro" = "aqua" -"tag" = "yellow" -"namespace" = "aqua" -"attribute" = "aqua" -"constructor" = "yellow" -"module" = "blue" -"special" = "orange" +"function.macro" = "green" +"tag" = "orange" +"namespace" = { fg = "yellow", modifiers = ["italic"] } +"attribute" = { fg = "purple", modifiers = ["italic"] } +"constructor" = "green" +"module" = "yellow" +"special" = "blue" -"markup.heading.marker" = "grey2" +"markup.heading.marker" = "grey1" "markup.heading.1" = { fg = "red", modifiers = ["bold"] } "markup.heading.2" = { fg = "orange", modifiers = ["bold"] } "markup.heading.3" = { fg = "yellow", modifiers = ["bold"] } "markup.heading.4" = { fg = "green", modifiers = ["bold"] } "markup.heading.5" = { fg = "blue", modifiers = ["bold"] } -"markup.heading.6" = { fg = "fg", modifiers = ["bold"] } +"markup.heading.6" = { fg = "purple", modifiers = ["bold"] } "markup.list" = "red" "markup.bold" = { modifiers = ["bold"] } "markup.italic" = { modifiers = ["italic"] } "markup.strikethrough" = { modifiers = ["crossed_out"] } -"markup.link.url" = { fg = "blue", modifiers = ["underlined"] } +"markup.link.url" = { fg = "blue", underline = { style = "line" } } +"markup.link.label" = "orange" "markup.link.text" = "purple" -"markup.quote" = "grey2" -"markup.raw" = "green" +"markup.quote" = "grey1" +"markup.raw.inline" = "green" +"markup.raw.block" = "aqua" "diff.plus" = "green" -"diff.delta" = "orange" +"diff.delta" = "blue" "diff.minus" = "red" "ui.background" = { bg = "bg0" } -"ui.background.separator" = "grey0" -"ui.cursor" = { fg = "bg0", bg = "fg" } -"ui.cursor.match" = { fg = "orange", bg = "bg_yellow" } +"ui.background.separator" = "bg_visual" +"ui.cursor" = { fg = "bg1", bg = "grey2" } "ui.cursor.insert" = { fg = "bg0", bg = "grey1" } "ui.cursor.select" = { fg = "bg0", bg = "blue" } +"ui.cursor.match" = { bg = "bg4", modifiers = ["bold"] } +"ui.cursor.primary" = { fg = "bg0", bg = "fg" } "ui.cursorline.primary" = { bg = "bg1" } -"ui.cursorline.secondary" = { bg = "bg1" } +"ui.cursorline.secondary" = { bg = "bg2" } "ui.selection" = { bg = "bg3" } "ui.linenr" = "grey0" -"ui.linenr.selected" = "fg" +"ui.linenr.selected" = "grey2" "ui.statusline" = { fg = "grey2", bg = "bg3" } "ui.statusline.inactive" = { fg = "grey0", bg = "bg1" } -"ui.statusline.normal" = { fg = "bg0", bg = "grey2", modifiers = ["bold"] } -"ui.statusline.insert" = { fg = "bg0", bg = "yellow", modifiers = ["bold"] } +"ui.statusline.normal" = { fg = "bg0", bg = "statusline1", modifiers = [ + "bold", +] } +"ui.statusline.insert" = { fg = "bg0", bg = "statusline2", modifiers = [ + "bold", +] } "ui.statusline.select" = { fg = "bg0", bg = "blue", modifiers = ["bold"] } -"ui.bufferline" = { fg = "grey0", bg = "bg1" } -"ui.bufferline.active" = { fg = "fg", bg = "bg3", modifiers = ["bold"] } +"ui.bufferline" = { fg = "grey2", bg = "bg3" } +"ui.bufferline.active" = { fg = "bg0", bg = "statusline1", modifiers = [ + "bold", +] } "ui.popup" = { fg = "grey2", bg = "bg2" } -"ui.window" = { fg = "grey0", bg = "bg0" } +"ui.window" = { fg = "bg4", bg = "bg_dim" } "ui.help" = { fg = "fg", bg = "bg2" } "ui.text" = "fg" "ui.text.focus" = "fg" @@ -85,38 +99,43 @@ "ui.virtual.indent-guide" = { fg = "bg4" } "ui.virtual.ruler" = { bg = "bg3" } -"hint" = "blue" -"info" = "aqua" +"hint" = "green" +"info" = "blue" "warning" = "yellow" "error" = "red" -"diagnostic.hint" = { underline = { color = "blue", style = "curl" } } -"diagnostic.info" = { underline = { color = "aqua", style = "curl" } } +"diagnostic.hint" = { underline = { color = "green", style = "curl" } } +"diagnostic.info" = { underline = { color = "blue", style = "curl" } } "diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } "diagnostic.error" = { underline = { color = "red", style = "curl" } } [palette] -bg0 = "#fff9e8" -bg1 = "#f7f4e0" -bg2 = "#f0eed9" -bg3 = "#e9e8d2" -bg4 = "#e1ddcb" -bg5 = "#bec5b2" -bg_visual = "#edf0cd" -bg_red = "#fce5dc" -bg_green = "#f1f3d4" -bg_blue = "#eaf2eb" -bg_yellow = "#fbefd0" +bg_dim = "#efebd4" +bg0 = "#fdf6e3" +bg1 = "#f4f0d9" +bg2 = "#efebd4" +bg3 = "#e6e2cc" +bg4 = "#e0dcc7" +bg5 = "#bdc3af" +bg_red = "#fbe3da" +bg_visual = "#eaedc8" +bg_yellow = "#faedcd" +bg_green = "#f0f1d2" +bg_blue = "#e9f0e9" fg = "#5c6a72" red = "#f85552" orange = "#f57d26" yellow = "#dfa000" green = "#8da101" -aqua = "#35a77c" blue = "#3a94c5" +aqua = "#35a77c" purple = "#df69ba" + grey0 = "#a6b0a0" grey1 = "#939f91" grey2 = "#829181" +statusline1 = "#93b259" +statusline2 = "#708089" +statusline3 = "#e66868" From bfcc4c37955775bb9365223d630f0135ce673f51 Mon Sep 17 00:00:00 2001 From: basbebe Date: Wed, 8 Feb 2023 08:41:22 +0100 Subject: [PATCH 05/44] Everforest: Fix keywords and types --- runtime/themes/everforest_dark.toml | 8 +++++--- runtime/themes/everforest_light.toml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/themes/everforest_dark.toml b/runtime/themes/everforest_dark.toml index 3dd9243f6049..b1fa02ef3d44 100644 --- a/runtime/themes/everforest_dark.toml +++ b/runtime/themes/everforest_dark.toml @@ -8,7 +8,7 @@ # Email: sainnhe@gmail.com # License: MIT License -"type" = { fg = "yellow", modifiers = ["italic"] } +"type" = "yellow" "constant" = "fg" "constant.builtin" = { fg = "purple", modifiers = ["italic"] } "constant.builtin.boolean" = "purple" @@ -30,7 +30,7 @@ "keyword" = "red" "keyword.operator" = "orange" "keyword.directive" = "purple" -"keyword.storage" = "orange" +"keyword.storage" = "red" "operator" = "orange" "function" = "green" "function.macro" = "green" @@ -85,7 +85,9 @@ ] } "ui.statusline.select" = { fg = "bg0", bg = "blue", modifiers = ["bold"] } "ui.bufferline" = { fg = "grey2", bg = "bg3" } -"ui.bufferline.active" = { fg = "bg0", bg = "statusline1", modifiers = ["bold"] } +"ui.bufferline.active" = { fg = "bg0", bg = "statusline1", modifiers = [ + "bold", +] } "ui.popup" = { fg = "grey2", bg = "bg2" } "ui.window" = { fg = "bg4", bg = "bg_dim" } "ui.help" = { fg = "fg", bg = "bg2" } diff --git a/runtime/themes/everforest_light.toml b/runtime/themes/everforest_light.toml index ef0544ac6594..54201ab0e962 100644 --- a/runtime/themes/everforest_light.toml +++ b/runtime/themes/everforest_light.toml @@ -8,7 +8,7 @@ # Email: sainnhe@gmail.com # License: MIT License -"type" = { fg = "yellow", modifiers = ["italic"] } +"type" = "yellow" "constant" = "fg" "constant.builtin" = { fg = "purple", modifiers = ["italic"] } "constant.builtin.boolean" = "purple" @@ -30,7 +30,7 @@ "keyword" = "red" "keyword.operator" = "orange" "keyword.directive" = "purple" -"keyword.storage" = "orange" +"keyword.storage" = "red" "operator" = "orange" "function" = "green" "function.macro" = "green" From 1421b67a4c1c6c252479b7ea45c183fa6cd7078d Mon Sep 17 00:00:00 2001 From: basbebe Date: Thu, 6 Apr 2023 09:00:29 +0200 Subject: [PATCH 06/44] Everforest theme: Style inlay-hints and wrap indicator --- runtime/themes/everforest_dark.toml | 4 +++- runtime/themes/everforest_light.toml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/themes/everforest_dark.toml b/runtime/themes/everforest_dark.toml index b1fa02ef3d44..6903d1e5430c 100644 --- a/runtime/themes/everforest_dark.toml +++ b/runtime/themes/everforest_dark.toml @@ -95,9 +95,11 @@ "ui.text.focus" = "fg" "ui.menu" = { fg = "fg", bg = "bg3" } "ui.menu.selected" = { fg = "bg0", bg = "green" } +"ui.virtual.ruler" = { bg = "bg3" } "ui.virtual.whitespace" = { fg = "bg4" } "ui.virtual.indent-guide" = { fg = "bg4" } -"ui.virtual.ruler" = { bg = "bg3" } +"ui.virtual.inlay-hint" = { fg = "grey0" } +"ui.virtual.wrap" = { fg = "grey0" } "hint" = "green" "info" = "blue" diff --git a/runtime/themes/everforest_light.toml b/runtime/themes/everforest_light.toml index 54201ab0e962..cf39e23d62fd 100644 --- a/runtime/themes/everforest_light.toml +++ b/runtime/themes/everforest_light.toml @@ -95,9 +95,11 @@ "ui.text.focus" = "fg" "ui.menu" = { fg = "fg", bg = "bg3" } "ui.menu.selected" = { fg = "bg0", bg = "green" } +"ui.virtual.ruler" = { bg = "bg3" } "ui.virtual.whitespace" = { fg = "bg4" } "ui.virtual.indent-guide" = { fg = "bg4" } -"ui.virtual.ruler" = { bg = "bg3" } +"ui.virtual.inlay-hint" = { fg = "grey0" } +"ui.virtual.wrap" = { fg = "grey0" } "hint" = "green" "info" = "blue" From deab323c28dfcc12f94a2e0c96a2a0635a0b6748 Mon Sep 17 00:00:00 2001 From: Ollie Charles Date: Wed, 12 Apr 2023 15:35:01 +0100 Subject: [PATCH 07/44] Update tree-sitter-haskell (#6317) --- languages.toml | 2 +- runtime/queries/haskell/textobjects.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index e7c374992e41..22c1842e958d 100644 --- a/languages.toml +++ b/languages.toml @@ -882,7 +882,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "haskell" -source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "b6ec26f181dd059eedd506fa5fbeae1b8e5556c8" } +source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "98fc7f59049aeb713ab9b72a8ff25dcaaef81087" } [[language]] name = "purescript" diff --git a/runtime/queries/haskell/textobjects.scm b/runtime/queries/haskell/textobjects.scm index 9870dc4a4128..457fba1a791e 100644 --- a/runtime/queries/haskell/textobjects.scm +++ b/runtime/queries/haskell/textobjects.scm @@ -2,7 +2,7 @@ [ (adt) - (decl_type) + (type_alias) (newtype) ] @class.around From 3e2eca0db85361d355de276b98797a86f0335e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Delafargue?= Date: Wed, 12 Apr 2023 16:36:57 +0200 Subject: [PATCH 08/44] tree-sitter(haskell): use quasiquoters as an injection point (#6474) Similar to tagged templates in JS, quasiquoters allow to embed external languages in haskell, so it makes sense to treat them as an injection point. --- runtime/queries/haskell/injections.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/queries/haskell/injections.scm b/runtime/queries/haskell/injections.scm index 321c90add371..788b8b8c6cbb 100644 --- a/runtime/queries/haskell/injections.scm +++ b/runtime/queries/haskell/injections.scm @@ -1,2 +1,6 @@ ((comment) @injection.content (#set! injection.language "comment")) + +(quasiquote + (quoter) @injection.language + (quasiquote_body) @injection.content) From f6d65cf089a0b845ef01b91d0424a9ffe1e9ea45 Mon Sep 17 00:00:00 2001 From: Chirikumbrah <78883260+Chirikumbrah@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:38:15 +0300 Subject: [PATCH 09/44] Refactor dracula theme (#6552) --- runtime/themes/dracula.toml | 211 +++++++++++++++++++++++------------- 1 file changed, 135 insertions(+), 76 deletions(-) diff --git a/runtime/themes/dracula.toml b/runtime/themes/dracula.toml index 6935b487f42b..f1d895f9d6d6 100644 --- a/runtime/themes/dracula.toml +++ b/runtime/themes/dracula.toml @@ -1,83 +1,142 @@ # Author : Sebastian Zivota -"comment" = { fg = "comment" } -"constant" = { fg = "purple" } -"constant.character.escape" = { fg = "pink" } -"function" = { fg = "green" } -"keyword" = { fg = "pink" } -"operator" = { fg = "pink" } -"punctuation" = { fg = "foreground" } -"string" = { fg = "yellow" } -"string.regexp" = { fg = "red" } -"tag" = { fg = "pink" } -"type" = { fg = "cyan", modifiers = ["italic"] } -"type.enum.variant" = { fg = "foreground", modifiers = ["italic"] } -"variable" = { fg = "foreground" } -"variable.builtin" = { fg = "cyan", modifiers = ["italic"] } -"variable.parameter" = { fg ="orange", modifiers = ["italic"] } +# Author : Chirikumbrah -"diff.plus" = { fg = "green" } -"diff.delta" = { fg = "orange" } -"diff.minus" = { fg = "red" } +"annotation" = { fg = "white" } +"attribute" = { fg = "cyan" } +"comment" = { fg = "comment" } +"constant" = { fg = "purple" } +"constant.numeric" = { fg = "orange" } +"constant.builtin" = { fg = "orange" } +"constant.character.escape" = { fg = "pink" } +"constant.macro" = { fg = "purple" } +"constructor" = { fg = "cyan" } +"conditional" = { fg = "pink" } +"character" = { fg = "purple" } +"definition".underline = { sp = "cyan" } +"field.key" = { fg = "purple" } +"field" = { fg = "purple" } +"function" = { fg = "green" } +"function.builtin" = { fg = "green" } +"function.method" = { fg = "green" } +"function.macro" = { fg = "purple" } +"function.call" = { fg = "green" } +"keyword" = { fg = "pink" } +"keyword.operator" = { fg = "pink" } +"keyword.function" = { fg = "pink" } +"keyword.return" = { fg = "pink" } +"keyword.control.import" = { fg = "green" } +"keyword.directive" = { fg = "green" } +"keyword.control.repeat" = { fg = "cyan" } +"keyword.control.exception" = { fg = "purple" } +"keyword.storage.type" = { fg = "cyan" } +"keyword.storage.modifier" = { fg = "cyan" } +"method.call" = { fg = "green" } +"reference" = { fg = "grey" } +"special" = { fg = "orange" } +"symbol" = { fg = "yellow" } +"tag.attribute" = { fg = "purple" } +"tag.delimiter" = { fg = "white" } +"operator" = { fg = "pink" } +"label" = { fg = "cyan" } +"punctuation" = { fg = "white" } +"punctuation.bracket" = { fg = "white" } +"punctuation.delimiter" = { fg = "white" } +"punctuation.special" = { fg = "purple" } +"string" = { fg = "yellow" } +"string.regexp" = { fg = "cyan" } +"string.escape" = { fg = "cyan" } +"string.special" = { fg = "cyan" } +"tag" = { fg = "pink" } +"text" = { fg = "grey" } +"text.strong" = { modifiers = "bold" } +"text.emphasis" = { fg = "orange" } +"text.strike" = { fg = "white" } +"text.literal" = { fg = "orange" } +"text.uri".underline = { fg = "orange" } +"type.builtin" = { fg = "cyan", modifiers = ["italic"] } +"type" = { fg = "cyan", modifiers = ["italic"] } +"type.enum.variant" = { fg = "white", modifiers = ["italic"] } +"property" = { fg = "purple" } +"structure" = { fg = "purple" } +"scope" = { modifiers = "bold" } +"variable" = { fg = "purple" } +"variable.builtin" = { fg = "orange", modifiers = ["italic"] } +"variable.parameter" = { fg = "purple", modifiers = ["italic"] } +"parameter" = { fg = "orange" } -"ui.background" = { fg = "foreground", bg = "background" } -"ui.cursor" = { fg = "background", bg = "orange", modifiers = ["dim"] } -"ui.cursor.match" = { fg = "green", modifiers = ["underlined"] } -"ui.cursor.primary" = { fg = "background", bg = "cyan", modifiers = ["dim"] } -"ui.cursorline.primary" = { bg = "background_dark" } -"ui.help" = { fg = "foreground", bg = "background_dark" } -"ui.debug" = { fg = "red" } -"ui.highlight.frameline" = { fg = "black", bg = "red" } -"ui.linenr" = { fg = "comment" } -"ui.linenr.selected" = { fg = "foreground" } -"ui.menu" = { fg = "foreground", bg = "background_dark" } -"ui.menu.selected" = { fg = "cyan", bg = "background_dark" } -"ui.popup" = { fg = "foreground", bg = "background_dark" } -"ui.selection" = { bg = "secondary_highlight" } -"ui.selection.primary" = { bg = "primary_highlight" } -"ui.statusline" = { fg = "foreground", bg = "background_dark" } -"ui.statusline.inactive" = { fg = "comment", bg = "background_dark" } -"ui.statusline.normal" = { fg = "background_dark", bg = "cyan" } -"ui.statusline.insert" = { fg = "background_dark", bg = "green" } -"ui.statusline.select" = { fg = "background_dark", bg = "purple" } -"ui.text" = { fg = "foreground" } -"ui.text.focus" = { fg = "cyan" } -"ui.window" = { fg = "foreground" } -"ui.virtual.whitespace" = { fg = "subtle" } -"ui.virtual.wrap" = { fg = "subtle" } -"ui.virtual.ruler" = { bg = "background_dark"} -"ui.virtual.inlay-hint" = { fg = "comment" } -"ui.virtual.inlay-hint.parameter" = { fg = "comment", modifiers = ["italic"] } -"ui.virtual.inlay-hint.type" = { fg = "comment", modifiers = ["italic"] } -"error" = { fg = "red" } -"warning" = { fg = "cyan" } +"diff.plus" = { fg = "green" } +"diff.delta" = { fg = "orange" } +"diff.minus" = { fg = "red" } +"ui.background" = { fg = "white", bg = "background" } +"ui.cursor.match" = { fg = "white", bg = "grey" } +"ui.cursor" = { fg = "background", bg = "purple", modifiers = ["dim"] } +"ui.cursor.normal" = { fg = "background", bg = "purple", modifiers = ["dim"] } +"ui.cursor.insert" = { fg = "background", bg = "green", modifiers = ["dim"] } +"ui.cursor.select" = { fg = "background", bg = "cyan", modifiers = ["dim"] } +"ui.cursor.primary.normal" = { fg = "background", bg = "purple" } +"ui.cursor.primary.insert" = { fg = "background", bg = "green" } +"ui.cursor.primary.select" = { fg = "background", bg = "cyan" } +"ui.cursorline.primary" = { bg = "cursorline" } +"ui.help" = { fg = "white", bg = "black" } +"ui.debug" = { fg = "red" } +"ui.highlight.frameline" = { fg = "background", bg = "red" } +"ui.linenr" = { fg = "comment" } +"ui.linenr.selected" = { fg = "white" } +"ui.menu" = { fg = "white", bg = "black" } +"ui.menu.selected" = { fg = "cyan", bg = "black" } +"ui.popup" = { fg = "white", bg = "black" } +"ui.selection.primary" = { bg = "selection_primary" } +"ui.selection" = { bg = "selection" } +"ui.statusline" = { fg = "white", bg = "darker" } +"ui.statusline.inactive" = { fg = "comment", bg = "darker" } +"ui.statusline.normal" = { fg = "black", bg = "purple" } +"ui.statusline.insert" = { fg = "black", bg = "green" } +"ui.statusline.select" = { fg = "black", bg = "cyan" } +"ui.text" = { fg = "white" } +"ui.text.focus" = { fg = "cyan" } +"ui.window" = { fg = "white" } +"ui.virtual.whitespace" = { fg = "subtle" } +"ui.virtual.wrap" = { fg = "subtle" } +"ui.virtual.ruler" = { bg = "black" } +"ui.virtual.inlay-hint" = { fg = "cyan" } +"ui.virtual.inlay-hint.parameter" = { fg = "cyan", modifiers = ["italic", "dim"] } +"ui.virtual.inlay-hint.type" = { fg = "cyan", modifiers = ["italic", "dim"] } +"hint" = { fg = "purple" } +"error" = { fg = "red" } +"warning" = { fg = "yellow" } +"info" = { fg = "cyan" } +"markup.heading" = { fg = "purple", modifiers = ["bold"] } +"markup.list" = { fg = "cyan" } +"markup.bold" = { fg = "orange", modifiers = ["bold"] } +"markup.italic" = { fg = "yellow", modifiers = ["italic"] } +"markup.strikethrough" = { modifiers = ["crossed_out"] } +"markup.link.url" = { fg = "cyan" } +"markup.link.text" = { fg = "pink" } +"markup.quote" = { fg = "yellow", modifiers = ["italic"] } +"markup.raw" = { fg = "white" } +"diagnostic" = { underline = { color = "orange", style = "curl" } } +"diagnostic.hint" = { underline = { color = "purple", style = "curl" } } +"diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } +"diagnostic.error" = { underline = { color = "red", style = "curl" } } +"diagnostic.info" = { underline = { color = "cyan", style = "curl" } } -"markup.heading" = { fg = "purple", modifiers = ["bold"] } -"markup.list" = "cyan" -"markup.bold" = { fg = "orange", modifiers = ["bold"] } -"markup.italic" = { fg = "yellow", modifiers = ["italic"] } -"markup.strikethrough" = { modifiers = ["crossed_out"] } -"markup.link.url" = "cyan" -"markup.link.text" = "pink" -"markup.quote" = { fg = "yellow", modifiers = ["italic"] } -"markup.raw" = { fg = "foreground" } - -"diagnostic".underline = { color = "orange", style = "curl" } -"diagnostic.error".underline = { color = "red", style = "curl" } [palette] -background = "#282a36" -background_dark = "#21222c" -primary_highlight = "#800049" -secondary_highlight = "#4d4f66" -subtle = "#424450" -foreground = "#f8f8f2" -comment = "#6272a4" -red = "#ff5555" -orange = "#ffb86c" -yellow = "#f1fa8c" -green = "#50fa7b" -purple = "#bd93f9" -cyan = "#8be9fd" -pink = "#ff79c6" - +background = "#282A36" +cursorline = "#2d303e" +darker = "#222430" +black = "#191A21" +grey = "#666771" +comment = "#6272A4" +selection_primary = "#44475a" +selection = "#363848" +subtle = "#424450" +white = "#f8f8f2" +red = "#ff5555" +orange = "#ffb86c" +yellow = "#f1fa8c" +green = "#50fa7b" +purple = "#BD93F9" +cyan = "#8be9fd" +pink = "#ff79c6" From fed5e6e646b157faa3fd2be494209e68e132a8c1 Mon Sep 17 00:00:00 2001 From: Farzin Date: Wed, 12 Apr 2023 18:25:22 +0330 Subject: [PATCH 10/44] Highlight C/C++ escape sequences (#6724) --- runtime/queries/c/highlights.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/queries/c/highlights.scm b/runtime/queries/c/highlights.scm index 8122216d8782..07915f4e3e20 100644 --- a/runtime/queries/c/highlights.scm +++ b/runtime/queries/c/highlights.scm @@ -107,6 +107,7 @@ (null) @constant (number_literal) @constant.numeric (char_literal) @constant.character +(escape_sequence) @constant.character.escape (call_expression function: (identifier) @function) From 70de5026b801fb1a0eb54acc2d3685291c8e14f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Wed, 12 Apr 2023 17:28:03 +0200 Subject: [PATCH 11/44] feat(languages): Support markdoc (#6432) Add basic support for [markdoc](https://markdoc.dev/). For language server, see: https://github.com/markdoc-extra/markdoc-ls For tree sitter, see: https://github.com/markdoc-extra/tree-sitter-markdoc --- book/src/generated/lang-support.md | 1 + languages.toml | 11 +++++++++++ runtime/queries/markdoc/highlights.scm | 16 ++++++++++++++++ runtime/queries/markdoc/injections.scm | 2 ++ 4 files changed, 30 insertions(+) create mode 100644 runtime/queries/markdoc/highlights.scm create mode 100644 runtime/queries/markdoc/injections.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 28dfeb049120..07aabef826f4 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -81,6 +81,7 @@ | llvm-mir-yaml | ✓ | | ✓ | | | lua | ✓ | ✓ | ✓ | `lua-language-server` | | make | ✓ | | | | +| markdoc | ✓ | | | `markdoc-ls` | | markdown | ✓ | | | `marksman` | | markdown.inline | ✓ | | | | | matlab | ✓ | | | | diff --git a/languages.toml b/languages.toml index 22c1842e958d..9e55dd4e00a3 100644 --- a/languages.toml +++ b/languages.toml @@ -2461,3 +2461,14 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "hurl" source = { git = "https://github.com/pfeiferj/tree-sitter-hurl", rev = "264c42064b61ee21abe88d0061f29a0523352e22" } + +[[language]] +name = "markdoc" +scope = "text.markdoc" +roots = [] +file-types = ["mdoc"] +language-server = { command = "markdoc-ls", args = ["--stdio"] } + +[[grammar]] +name = "markdoc" +source = { git = "https://github.com/markdoc-extra/tree-sitter-markdoc", rev = "5ffe71b29e8a3f94823913ea9cea51fcfa7e3bf8" } diff --git a/runtime/queries/markdoc/highlights.scm b/runtime/queries/markdoc/highlights.scm new file mode 100644 index 000000000000..8251e9afe2f5 --- /dev/null +++ b/runtime/queries/markdoc/highlights.scm @@ -0,0 +1,16 @@ +tag_name: (identifier) @tag +(tag_self_closing "/" @tag) +(tag_close "/" @tag) +([(tag_start) (tag_end) "="] @tag) +(attribute [key : (identifier)] @attribute) +(attribute [shorthand : (identifier)] @attribute) +(variable [variable : (identifier) (variable_sigil)] @variable) +(variable_tail property : (identifier) @variable.other.member) +(function function_name : (identifier) @function) +(function_parameter_named parameter : (identifier) @variable.parameter) + +(hash_key key: (identifier) @variable.other.member) +(string) @string +(number) @constant.numeric +(boolean) @constant.builtin.boolean +(null) @constant.builtin diff --git a/runtime/queries/markdoc/injections.scm b/runtime/queries/markdoc/injections.scm new file mode 100644 index 000000000000..1594546badca --- /dev/null +++ b/runtime/queries/markdoc/injections.scm @@ -0,0 +1,2 @@ +((markdown) @injection.content + (#set! injection.language "markdown")) From fff8543b5809766608be14ee1a45f8b86f5a3de2 Mon Sep 17 00:00:00 2001 From: lefp <70862148+lefp@users.noreply.github.com> Date: Wed, 12 Apr 2023 15:42:41 -0400 Subject: [PATCH 12/44] Add OpenCL tree-sitter and LSP config (#6473) --- book/src/generated/lang-support.md | 1 + languages.toml | 13 +++ runtime/queries/opencl/highlights.scm | 150 +++++++++++++++++++++++++ runtime/queries/opencl/indents.scm | 1 + runtime/queries/opencl/injections.scm | 1 + runtime/queries/opencl/textobjects.scm | 1 + 6 files changed, 167 insertions(+) create mode 100644 runtime/queries/opencl/highlights.scm create mode 100644 runtime/queries/opencl/indents.scm create mode 100644 runtime/queries/opencl/injections.scm create mode 100644 runtime/queries/opencl/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 07aabef826f4..b458bd6f15dc 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -97,6 +97,7 @@ | ocaml | ✓ | | ✓ | `ocamllsp` | | ocaml-interface | ✓ | | | `ocamllsp` | | odin | ✓ | | | `ols` | +| opencl | ✓ | ✓ | ✓ | `clangd` | | openscad | ✓ | | | `openscad-lsp` | | org | ✓ | | | | | pascal | ✓ | ✓ | | `pasls` | diff --git a/languages.toml b/languages.toml index 9e55dd4e00a3..866881370ce4 100644 --- a/languages.toml +++ b/languages.toml @@ -2472,3 +2472,16 @@ language-server = { command = "markdoc-ls", args = ["--stdio"] } [[grammar]] name = "markdoc" source = { git = "https://github.com/markdoc-extra/tree-sitter-markdoc", rev = "5ffe71b29e8a3f94823913ea9cea51fcfa7e3bf8" } + +[[language]] +name = "opencl" +scope = "source.cl" +injection-regex = "(cl|opencl)" +file-types = ["cl"] +roots = [] +comment-token = "//" +language-server = { command = "clangd" } + +[[grammar]] +name = "opencl" +source = { git = "https://github.com/lefp/tree-sitter-opencl", rev = "8e1d24a57066b3cd1bb9685bbc1ca9de5c1b78fb" } diff --git a/runtime/queries/opencl/highlights.scm b/runtime/queries/opencl/highlights.scm new file mode 100644 index 000000000000..9d76d6c66dfa --- /dev/null +++ b/runtime/queries/opencl/highlights.scm @@ -0,0 +1,150 @@ +[ + "sizeof" + ; @todo why does "uniform" break highlighting? + ; "uniform" ; OpenCL C 3.0.13 reserves this as a keyword, but doesn't seem to use it for anything + (function_qualifier) +] @keyword + +[ + "enum" + "struct" + "typedef" + "union" +] @keyword.storage.type + +[ + "extern" + "register" + (type_qualifier) + (access_qualifier) + (storage_class_specifier) + (address_space_qualifier) +] @keyword.storage.modifier + +[ + "goto" + "break" + "continue" +] @keyword.control + +[ + "do" + "for" + "while" +] @keyword.control.repeat + +[ + "if" + "else" + "switch" + "case" + "default" +] @keyword.control.conditional + +"return" @keyword.control.return + +[ + "defined" + "#define" + "#elif" + "#else" + "#endif" + "#if" + "#ifdef" + "#ifndef" + "#include" + (preproc_directive) +] @keyword.directive + +(pointer_declarator "*" @type.builtin) +(abstract_pointer_declarator "*" @type.builtin) + +[ + "+" + "-" + "*" + "/" + "++" + "--" + "%" + "==" + "!=" + ">" + "<" + ">=" + "<=" + "&&" + "||" + "!" + "&" + "|" + "^" + "~" + "<<" + ">>" + "=" + "+=" + "-=" + "*=" + "/=" + "%=" + "<<=" + ">>=" + "&=" + "^=" + "|=" + "?" +] @operator + +(conditional_expression ":" @operator) + +"..." @punctuation + +["," "." ":" ";" "->" "::"] @punctuation.delimiter + +["(" ")" "[" "]" "{" "}"] @punctuation.bracket + +[(true) (false)] @constant.builtin.boolean + +(enumerator name: (identifier) @type.enum.variant) + +(string_literal) @string +(system_lib_string) @string + +(null) @constant +(number_literal) @constant.numeric +(char_literal) @constant.character + +(call_expression + function: (identifier) @function) +(call_expression + function: (field_expression + field: (field_identifier) @function)) +(call_expression (argument_list (identifier) @variable)) +(function_declarator + declarator: [(identifier) (field_identifier)] @function) +(parameter_declaration + declarator: (identifier) @variable.parameter) +(parameter_declaration + (pointer_declarator + declarator: (identifier) @variable.parameter)) +(preproc_function_def + name: (identifier) @function.special) + +(attribute + name: (identifier) @attribute) + +(field_identifier) @variable.other.member +(statement_identifier) @label +(type_identifier) @type +(scalar_type) @type.builtin +(sized_type_specifier) @type.builtin +(vector_type) @type.builtin +(other_builtin_type) @type.builtin + +((identifier) @constant + (#match? @constant "^[A-Z][A-Z\\d_]*$")) + +(identifier) @variable + +(comment) @comment diff --git a/runtime/queries/opencl/indents.scm b/runtime/queries/opencl/indents.scm new file mode 100644 index 000000000000..a5a5208ca9c7 --- /dev/null +++ b/runtime/queries/opencl/indents.scm @@ -0,0 +1 @@ +; inherits: c diff --git a/runtime/queries/opencl/injections.scm b/runtime/queries/opencl/injections.scm new file mode 100644 index 000000000000..a5a5208ca9c7 --- /dev/null +++ b/runtime/queries/opencl/injections.scm @@ -0,0 +1 @@ +; inherits: c diff --git a/runtime/queries/opencl/textobjects.scm b/runtime/queries/opencl/textobjects.scm new file mode 100644 index 000000000000..a5a5208ca9c7 --- /dev/null +++ b/runtime/queries/opencl/textobjects.scm @@ -0,0 +1 @@ +; inherits: c From 161fef2166e851071176e2fdaa9455efb5af0a6d Mon Sep 17 00:00:00 2001 From: Michael <20937441+KMikeeU@users.noreply.github.com> Date: Wed, 12 Apr 2023 22:28:51 +0200 Subject: [PATCH 13/44] Add DTD language support (#6644) - Added syntax highlighting for the DTD subset of the XML spec. - Included .dtd and .ent as common file extensions --- book/src/generated/lang-support.md | 1 + languages.toml | 20 +++++++++++++++ runtime/queries/dtd/highlights.scm | 39 ++++++++++++++++++++++++++++++ runtime/queries/dtd/injections.scm | 2 ++ 4 files changed, 62 insertions(+) create mode 100644 runtime/queries/dtd/highlights.scm create mode 100644 runtime/queries/dtd/injections.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index b458bd6f15dc..e434961bd8b6 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -28,6 +28,7 @@ | diff | ✓ | | | | | dockerfile | ✓ | | | `docker-langserver` | | dot | ✓ | | | `dot-language-server` | +| dtd | ✓ | | | | | edoc | ✓ | | | | | eex | ✓ | | | | | ejs | ✓ | | | | diff --git a/languages.toml b/languages.toml index 866881370ce4..c497e2964140 100644 --- a/languages.toml +++ b/languages.toml @@ -2099,6 +2099,26 @@ roots = [] name = "xml" source = { git = "https://github.com/RenjiSann/tree-sitter-xml", rev = "48a7c2b6fb9d515577e115e6788937e837815651" } + +[[language]] +name = "dtd" +scope = "source.dtd" +injection-regex = "dtd" +file-types = ["dtd", "ent"] +indent = {tab-width = 2, unit = " "} +roots = [] + +[language.auto-pairs] +'(' = ')' +'[' = ']' +'"' = '"' +"'" = "'" +'<' = '>' + +[[grammar]] +name = "dtd" +source = { git = "https://github.com/KMikeeU/tree-sitter-dtd", rev = "6116becb02a6b8e9588ef73d300a9ba4622e156f"} + [[language]] name = "wit" scope = "source.wit" diff --git a/runtime/queries/dtd/highlights.scm b/runtime/queries/dtd/highlights.scm new file mode 100644 index 000000000000..cb3d482b5aec --- /dev/null +++ b/runtime/queries/dtd/highlights.scm @@ -0,0 +1,39 @@ +; highlights.scm + +(comment) @comment + +[ + "ELEMENT" + "ATTLIST" +] @keyword + +[ + "#REQUIRED" + "#IMPLIED" + "#FIXED" + "#PCDATA" +] @keyword.directive + +[ + "EMPTY" + "ANY" + "SYSTEM" + "PUBLIC" +] @constant + +(element_name) @module + + +(attribute_name) @attribute + +(system_literal) @string +(pubid_literal) @string +(attribute_value) @string + +[ + ">" + "" + " Date: Thu, 13 Apr 2023 01:43:34 +0200 Subject: [PATCH 14/44] Fix #6669: Theme preview doesn't return theme to normal (#6694) * Fix #6669: Theme preview doesn't return theme to normal when delete name with Alt-Backspace * Fix #6669: Return theme preview to normal theme for all remaining keybinds that change the promt text --- helix-term/src/ui/prompt.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 35ae8c2a8e0b..a9ccfb7378aa 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -511,11 +511,21 @@ impl Component for Prompt { ctrl!('e') | key!(End) => self.move_end(), ctrl!('a') | key!(Home) => self.move_start(), ctrl!('w') | alt!(Backspace) | ctrl!(Backspace) => { - self.delete_word_backwards(cx.editor) + self.delete_word_backwards(cx.editor); + (self.callback_fn)(cx, &self.line, PromptEvent::Update); + } + alt!('d') | alt!(Delete) | ctrl!(Delete) => { + self.delete_word_forwards(cx.editor); + (self.callback_fn)(cx, &self.line, PromptEvent::Update); + } + ctrl!('k') => { + self.kill_to_end_of_line(cx.editor); + (self.callback_fn)(cx, &self.line, PromptEvent::Update); + } + ctrl!('u') => { + self.kill_to_start_of_line(cx.editor); + (self.callback_fn)(cx, &self.line, PromptEvent::Update); } - alt!('d') | alt!(Delete) | ctrl!(Delete) => self.delete_word_forwards(cx.editor), - ctrl!('k') => self.kill_to_end_of_line(cx.editor), - ctrl!('u') => self.kill_to_start_of_line(cx.editor), ctrl!('h') | key!(Backspace) | shift!(Backspace) => { self.delete_char_backwards(cx.editor); (self.callback_fn)(cx, &self.line, PromptEvent::Update); From bff7fc8695f1d58b918f94dee7638f8a4a1e4b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Gonz=C3=A1lez?= Date: Wed, 12 Apr 2023 21:27:12 -0400 Subject: [PATCH 15/44] Add inlay hints styling to darcula theme (#6732) * Add inlay hints coloring for darcula theme * Add whitespace --------- Co-authored-by: Ivan Tham --- runtime/themes/darcula.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/themes/darcula.toml b/runtime/themes/darcula.toml index 2779a94406f0..53a271bd23bc 100644 --- a/runtime/themes/darcula.toml +++ b/runtime/themes/darcula.toml @@ -23,6 +23,7 @@ "ui.virtual.ruler" = { bg = "grey02" } "ui.virtual.indent-guide" = "grey02" "ui.virtual.whitespace" = "grey03" +"ui.virtual.inlay-hint" = { fg = "grey03", modifiers = ["italic"] } "ui.bufferline" = { fg = "grey04", bg = "grey00" } "ui.bufferline.active" = { fg = "grey07", bg = "grey02" } From 5ec41195a0dde08c559f9f1b95c0ff4054dfa2ba Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Thu, 13 Apr 2023 20:37:33 +0200 Subject: [PATCH 16/44] ensure :toggle soft-wrap.enable works by default (#6742) --- helix-view/src/editor.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 80c47ed083a8..52f86f2da467 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -749,7 +749,10 @@ impl Default for Config { bufferline: BufferLine::default(), indent_guides: IndentGuidesConfig::default(), color_modes: false, - soft_wrap: SoftWrap::default(), + soft_wrap: SoftWrap { + enable: Some(false), + ..SoftWrap::default() + }, text_width: 80, completion_replace: false, workspace_lsp_roots: Vec::new(), From bb275421997b9e2bd63b04227b7e345a193818d5 Mon Sep 17 00:00:00 2001 From: Farzin Date: Fri, 14 Apr 2023 04:04:40 +0330 Subject: [PATCH 17/44] Fix python highlights to support single character and alphanumeric constant identifier (#6751) --- runtime/queries/python/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index 70b91efbe65b..0c6a83c5403c 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -94,7 +94,7 @@ ; Variables ((identifier) @constant - (#match? @constant "^[A-Z_]{2,}$")) + (#match? @constant "^_*[A-Z][A-Z\\d_]*$")) ((identifier) @type (#match? @type "^[A-Z]")) From cd7ef578187cdd56764e6a439aadfdefcd8f80b3 Mon Sep 17 00:00:00 2001 From: zetashift Date: Fri, 14 Apr 2023 16:08:11 +0200 Subject: [PATCH 18/44] Change smithy language server to the one from AWS (#6572) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index c497e2964140..575ed82df81a 100644 --- a/languages.toml +++ b/languages.toml @@ -2399,7 +2399,7 @@ file-types = ["smithy"] roots = ["smithy-build.json"] comment-token = "//" indent = { tab-width = 4, unit = " " } -language-server = { command = "cs", args = ["launch", "com.disneystreaming.smithy:smithy-language-server:latest.release", "--", "0"] } +language-server = { command = "cs", args = ["launch", "--contrib", "smithy-language-server", "--", "0"] } [[grammar]] name = "smithy" From 78e8066c3e2e53711473ec5f11b0808ca7a94994 Mon Sep 17 00:00:00 2001 From: John Careaga Date: Fri, 14 Apr 2023 08:57:59 -0400 Subject: [PATCH 19/44] Replace 'Visual' (mode) with 'Select' in tutor --- runtime/tutor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/tutor b/runtime/tutor index a6682ed9234c..df4d6d5417ad 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -994,7 +994,7 @@ lines. * Type * to set the search register to the primary selection. - * Type n / N in Visual mode to add selections on each search + * Type n / N in Select mode to add selections on each search match. * Press Ctrl-s to save position to the jumplist. From 896404c7ead29c4c19564581ccb53b913440a583 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Fri, 14 Apr 2023 16:59:52 +0200 Subject: [PATCH 20/44] emit cargo metadata duiring build scripts to avoid outdated buildscript outputs (#6743) * rebuild on revision change * rerun grammar build if grammars change --- helix-loader/build.rs | 39 ++++++++++++++++++++++++++++++++++++- helix-loader/src/grammar.rs | 12 ++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/helix-loader/build.rs b/helix-loader/build.rs index c4b89e6b93fe..63548a0c82d1 100644 --- a/helix-loader/build.rs +++ b/helix-loader/build.rs @@ -1,4 +1,5 @@ use std::borrow::Cow; +use std::path::Path; use std::process::Command; const VERSION: &str = include_str!("../VERSION"); @@ -11,7 +12,7 @@ fn main() { .filter(|output| output.status.success()) .and_then(|x| String::from_utf8(x.stdout).ok()); - let version: Cow<_> = match git_hash { + let version: Cow<_> = match &git_hash { Some(git_hash) => format!("{} ({})", VERSION, &git_hash[..8]).into(), None => VERSION.into(), }; @@ -23,4 +24,40 @@ fn main() { println!("cargo:rerun-if-changed=../VERSION"); println!("cargo:rustc-env=VERSION_AND_GIT_HASH={}", version); + + if git_hash.is_none() { + return; + } + + // we need to revparse because the git dir could be anywhere if you are + // using detached worktrees but there is no good way to obtain an OsString + // from command output so for now we can't accept non-utf8 paths here + // probably rare enouch where it doesn't matter tough we could use gitoxide + // here but that would be make it a hard dependency and slow compile times + let Some(git_dir): Option = Command::new("git") + .args(["rev-parse", "--git-dir"]) + .output() + .ok() + .filter(|output| output.status.success()) + .and_then(|x| String::from_utf8(x.stdout).ok()) + else{ return; }; + // If heads starts pointing at something else (different branch) + // we need to return + let head = Path::new(&git_dir).join("HEAD"); + if head.exists() { + println!("cargo:rerun-if-changed={}", head.display()); + } + // if the thing head points to (branch) itself changes + // we need to return + let Some(head_ref): Option = Command::new("git") + .args(["symbolic-ref", "HEAD"]) + .output() + .ok() + .filter(|output| output.status.success()) + .and_then(|x| String::from_utf8(x.stdout).ok()) + else{ return; }; + let head_ref = Path::new(&git_dir).join(head_ref); + if head_ref.exists() { + println!("cargo:rerun-if-changed={}", head_ref.display()); + } } diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index a85cb274cfb8..2eb59a38e150 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -413,6 +413,18 @@ fn build_tree_sitter_library( let mut library_path = parser_lib_path.join(&grammar.grammar_id); library_path.set_extension(DYLIB_EXTENSION); + // if we are running inside a buildscript emit cargo metadata + // to detect if we are running from a buildscript check some env variables + // that cargo only sets for build scripts + if std::env::var("OUT_DIR").is_ok() && std::env::var("CARGO").is_ok() { + if let Some(scanner_path) = scanner_path.as_ref().and_then(|path| path.to_str()) { + println!("cargo:rerun-if-changed={scanner_path}"); + } + if let Some(parser_path) = parser_path.to_str() { + println!("cargo:rerun-if-changed={parser_path}"); + } + } + let recompile = needs_recompile(&library_path, &parser_path, &scanner_path) .context("Failed to compare source and binary timestamps")?; From 4cdba7cccdd6a9fe5fbb3d15c9db3edc147b7a90 Mon Sep 17 00:00:00 2001 From: VuiMuich Date: Fri, 14 Apr 2023 17:03:21 +0200 Subject: [PATCH 21/44] Add standalone language support for `just` (#6453) Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 17 ++++++++-- runtime/queries/just/folds.scm | 4 +++ runtime/queries/just/highlights.scm | 33 +++++++++++++++++++ runtime/queries/just/indents.scm | 3 ++ runtime/queries/just/injections.scm | 16 ++++++++++ runtime/queries/just/locals.scm | 10 ++++++ runtime/queries/just/textobjects.scm | 48 ++++++++++++++++++++++++++++ 8 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 runtime/queries/just/folds.scm create mode 100644 runtime/queries/just/highlights.scm create mode 100644 runtime/queries/just/indents.scm create mode 100644 runtime/queries/just/injections.scm create mode 100644 runtime/queries/just/locals.scm create mode 100644 runtime/queries/just/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index e434961bd8b6..331d212f5742 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -72,6 +72,7 @@ | jsonnet | ✓ | | | `jsonnet-language-server` | | jsx | ✓ | ✓ | ✓ | `typescript-language-server` | | julia | ✓ | ✓ | ✓ | `julia` | +| just | ✓ | ✓ | ✓ | | | kdl | ✓ | | | | | kotlin | ✓ | | | `kotlin-language-server` | | latex | ✓ | ✓ | | `texlab` | diff --git a/languages.toml b/languages.toml index 575ed82df81a..8a0aa66120cb 100644 --- a/languages.toml +++ b/languages.toml @@ -978,8 +978,8 @@ source = { git = "https://github.com/uyha/tree-sitter-cmake", rev = "6e51463ef30 [[language]] name = "make" scope = "source.make" -file-types = ["Makefile", "makefile", "mk", "Justfile", "justfile", ".justfile"] -injection-regex = "(make|makefile|Makefile|mk|just)" +file-types = ["Makefile", "makefile", "mk"] +injection-regex = "(make|makefile|Makefile|mk)" roots = [] comment-token = "#" indent = { tab-width = 4, unit = "\t" } @@ -2505,3 +2505,16 @@ language-server = { command = "clangd" } [[grammar]] name = "opencl" source = { git = "https://github.com/lefp/tree-sitter-opencl", rev = "8e1d24a57066b3cd1bb9685bbc1ca9de5c1b78fb" } + +[[language]] +name = "just" +scope = "source.just" +file-types = ["justfile", "Justfile", "just"] +injection-regex = "just" +roots = [] +comment-token = "#" +indent = { tab-width = 4, unit = "\t" } + +[[grammar]] +name = "just" +source = { git = "https://github.com/IndianBoy42/tree-sitter-just", rev = "8af0aab79854aaf25b620a52c39485849922f766" } diff --git a/runtime/queries/just/folds.scm b/runtime/queries/just/folds.scm new file mode 100644 index 000000000000..6fc68fbd44d1 --- /dev/null +++ b/runtime/queries/just/folds.scm @@ -0,0 +1,4 @@ +(body) @fold +(recipe) @fold +(interpolation) @fold +(item (_) @fold) diff --git a/runtime/queries/just/highlights.scm b/runtime/queries/just/highlights.scm new file mode 100644 index 000000000000..1026f654f0a0 --- /dev/null +++ b/runtime/queries/just/highlights.scm @@ -0,0 +1,33 @@ +(assignment (NAME) @variable) +(alias (NAME) @variable) +(value (NAME) @variable) +(parameter (NAME) @variable) +(setting (NAME) @keyword) +(setting "shell" @keyword) + +(call (NAME) @function) +(dependency (NAME) @function) +(depcall (NAME) @function) +(recipeheader (NAME) @function) + +(depcall (expression) @variable.parameter) +(parameter) @variable.parameter +(variadic_parameters) @variable.parameter + +["if" "else"] @keyword.control.conditional + +(string) @string + +(boolean ["true" "false"]) @constant.builtin.boolean + +(comment) @comment + +; (interpolation) @string + +(shebang interpreter:(TEXT) @keyword ) @comment + +["export" "alias" "set"] @keyword + +["@" "==" "!=" "+" ":="] @operator + +[ "(" ")" "[" "]" "{{" "}}" "{" "}"] @punctuation.bracket diff --git a/runtime/queries/just/indents.scm b/runtime/queries/just/indents.scm new file mode 100644 index 000000000000..3db597466079 --- /dev/null +++ b/runtime/queries/just/indents.scm @@ -0,0 +1,3 @@ +[ + (recipe_body) +] @indent diff --git a/runtime/queries/just/injections.scm b/runtime/queries/just/injections.scm new file mode 100644 index 000000000000..cae1035aeb07 --- /dev/null +++ b/runtime/queries/just/injections.scm @@ -0,0 +1,16 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +(shebang_recipe + (shebang + interpreter:(TEXT) @injection.language) + (shebang_body) @injection.content +) + +(source_file + (item (setting lang:(NAME) @injection.language)) + (item (recipe (body (recipe_body) @injection.content))) +) + +; ((interpolation (expression) @injection.content) +; (#set! injection.language "just")) diff --git a/runtime/queries/just/locals.scm b/runtime/queries/just/locals.scm new file mode 100644 index 000000000000..18e162a971fb --- /dev/null +++ b/runtime/queries/just/locals.scm @@ -0,0 +1,10 @@ +(assignment (NAME) @local.definition) +(alias left:(NAME) @local.definition) +(alias right:(NAME) @local.reference) +(value (NAME) @local.reference) +(parameter (NAME) @local.definition) + +(call (NAME) @local.reference) +(dependency (NAME) @local.reference) +(depcall (NAME) @local.reference) +(recipeheader (NAME) @local.definition) diff --git a/runtime/queries/just/textobjects.scm b/runtime/queries/just/textobjects.scm new file mode 100644 index 000000000000..4be379587e41 --- /dev/null +++ b/runtime/queries/just/textobjects.scm @@ -0,0 +1,48 @@ +(body) @function.inside +(recipe) @function.around +(expression + if:(expression) @function.inside +) +(expression + else:(expression) @function.inside +) +(interpolation (expression) @function.inside) @function.around +(settinglist (stringlist) @function.inside) @function.around + +(call (NAME) @class.inside) @class.around +(dependency (NAME) @class.inside) @class.around +(depcall (NAME) @class.inside) + +(dependency) @parameter.around +(depcall) @parameter.inside +(depcall (expression) @parameter.inside) + +(stringlist + (string) @parameter.inside + . ","? @_end + ; Commented out since we don't support `#make-range!` at the moment + ; (#make-range! "parameter.around" @parameter.inside @_end) +) +(parameters + [(parameter) + (variadic_parameters)] @parameter.inside + . " "? @_end + ; Commented out since we don't support `#make-range!` at the moment + ; (#make-range! "parameter.around" @parameter.inside @_end) +) + +(expression + (condition) @function.inside +) @function.around +(expression + if:(expression) @function.inside +) +(expression + else:(expression) @function.inside +) + +(item [(alias) (assignment) (export) (setting)]) @class.around +(recipeheader) @class.around +(line) @class.around + +(comment) @comment.around From 99a8b6159cef76acb0bb0a9a872a36155e8cf6cd Mon Sep 17 00:00:00 2001 From: Matthew Toohey Date: Sat, 15 Apr 2023 00:53:04 -0400 Subject: [PATCH 22/44] Fix go locals query for var_spec identifiers --- runtime/queries/go/locals.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/go/locals.scm b/runtime/queries/go/locals.scm index d240e2b78874..aae562571f5a 100644 --- a/runtime/queries/go/locals.scm +++ b/runtime/queries/go/locals.scm @@ -12,7 +12,7 @@ (identifier) @local.definition)) (var_spec - name: (identifier) @local.definition) + (identifier) @local.definition) (for_statement (range_clause From 523e9e457305d055cdbca1b21dab089002c93ffc Mon Sep 17 00:00:00 2001 From: dylrich Date: Sun, 16 Apr 2023 10:05:25 -0500 Subject: [PATCH 23/44] ferra: fix ruler overriding foreground style Ferra's current ruler styling overrides the foreground style, which is an odd look only for characters in the ruler column. This commit removes the foreground styling for the ruler rule. This is more in line with what other themes do for the ruler. --- runtime/themes/ferra.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/themes/ferra.toml b/runtime/themes/ferra.toml index da5339e2e06d..360ad02f6015 100644 --- a/runtime/themes/ferra.toml +++ b/runtime/themes/ferra.toml @@ -52,7 +52,7 @@ "ui.selection.primary" = { bg = "ferra_night", fg = "ferra_umber" } "ui.virtual" = { fg = "ferra_bark" } "ui.virtual.whitespace" = { fg = "ferra_bark" } -"ui.virtual.ruler" = { fg = "ferra_night", bg = "ferra_ash" } +"ui.virtual.ruler" = { bg = "ferra_ash" } "ui.virtual.indent-guide" = { fg = "ferra_ash" } "ui.virtual.inlay-hint" = { fg = "ferra_bark" } From 7607727483dbc6461749e3c2d9b9305431eb8fb2 Mon Sep 17 00:00:00 2001 From: karei Date: Sun, 16 Apr 2023 13:54:34 +0300 Subject: [PATCH 24/44] Add `inlay-hint` colours to Kanagawa Makes the LSP hints more legible against the background colour and more in line with the normal colours in the theme. --- runtime/themes/kanagawa.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/themes/kanagawa.toml b/runtime/themes/kanagawa.toml index a7d33f3ee5b8..d0576a4e3747 100644 --- a/runtime/themes/kanagawa.toml +++ b/runtime/themes/kanagawa.toml @@ -16,6 +16,9 @@ "ui.virtual" = "sumiInk4" "ui.virtual.ruler" = { bg = "sumiInk2" } +"ui.virtual.inlay-hint" = "fujiGray" +"ui.virtual.inlay-hint.parameter" = { fg = "carpYellow", modifiers = ["dim"] } +"ui.virtual.inlay-hint.type" = { fg = "waveAqua2", modifiers = ["dim"] } "ui.statusline" = { fg = "oldWhite", bg = "sumiInk0" } "ui.statusline.inactive" = { fg = "fujiGray", bg = "sumiInk0" } From 7706ff77eb8aea9471af822355cad337707b9fc5 Mon Sep 17 00:00:00 2001 From: Aleksey Kuznetsov Date: Sun, 16 Apr 2023 23:44:12 +0500 Subject: [PATCH 25/44] make :toggle-option print the new value (#6774) Co-authored-by: Michael Davis --- helix-term/src/commands/typed.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 3c954d20f6d3..eb5c156fb8e5 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1770,12 +1770,12 @@ fn toggle_option( let pointer = format!("/{}", key.replace('.', "/")); let value = config.pointer_mut(&pointer).ok_or_else(key_error)?; - if let Value::Bool(b) = *value { - *value = Value::Bool(!b); - } else { + let Value::Bool(old_value) = *value else { anyhow::bail!("Key `{}` is not toggle-able", key) - } + }; + let new_value = !old_value; + *value = Value::Bool(new_value); // This unwrap should never fail because we only replace one boolean value // with another, maintaining a valid json config let config = serde_json::from_value(config).unwrap(); @@ -1784,6 +1784,8 @@ fn toggle_option( .config_events .0 .send(ConfigEvent::Update(config))?; + cx.editor + .set_status(format!("Option `{}` is now set to `{}`", key, new_value)); Ok(()) } From 1b016a89d546fb84d3c737d7c4bacb9e26c8b893 Mon Sep 17 00:00:00 2001 From: shem Date: Sun, 16 Apr 2023 23:07:00 +0200 Subject: [PATCH 26/44] Fix crash on opening from suspend state (#6764) * Fix crash on opening from suspend state (#6725) * Fix code style * revert using of the imperative code style. Add panic if couldn't set terminal raw mode * remove redundant import of core::panic macros * small refactoring --- helix-term/src/application.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 4d28c8bed0c7..cda498e2fbbe 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -471,7 +471,17 @@ impl Application { } } signal::SIGCONT => { - self.claim_term().await.unwrap(); + // Copy/Paste from same issue from neovim: + // https://github.com/neovim/neovim/issues/12322 + // https://github.com/neovim/neovim/pull/13084 + for retries in 1..=10 { + match self.claim_term().await { + Ok(()) => break, + Err(err) if retries == 10 => panic!("Failed to claim terminal: {}", err), + Err(_) => continue, + } + } + // redraw the terminal let area = self.terminal.size().expect("couldn't get terminal size"); self.compositor.resize(area); From 8839eb0af47b99511956d81a6dbb32e948d2076c Mon Sep 17 00:00:00 2001 From: A-Walrus <58790821+A-Walrus@users.noreply.github.com> Date: Mon, 17 Apr 2023 23:36:04 +0300 Subject: [PATCH 27/44] Fix unwrap bug in DAP (#6786) --- helix-dap/src/client.rs | 10 +++----- helix-dap/src/transport.rs | 46 +++++++++++++++++++++------------- helix-view/src/handlers/dap.rs | 1 + 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs index 7efb72d80fc9..acdfc5b7ec95 100644 --- a/helix-dap/src/client.rs +++ b/helix-dap/src/client.rs @@ -62,12 +62,10 @@ impl Client { if command.is_empty() { return Result::Err(Error::Other(anyhow!("Command not provided"))); } - if transport == "tcp" && port_arg.is_some() { - Self::tcp_process(command, args, port_arg.unwrap(), id).await - } else if transport == "stdio" { - Self::stdio(command, args, id) - } else { - Result::Err(Error::Other(anyhow!("Incorrect transport {}", transport))) + match (transport, port_arg) { + ("tcp", Some(port_arg)) => Self::tcp_process(command, args, port_arg, id).await, + ("stdio", _) => Self::stdio(command, args, id), + _ => Result::Err(Error::Other(anyhow!("Incorrect transport {}", transport))), } } diff --git a/helix-dap/src/transport.rs b/helix-dap/src/transport.rs index dd03e56856b8..0f646b6a4b64 100644 --- a/helix-dap/src/transport.rs +++ b/helix-dap/src/transport.rs @@ -230,38 +230,48 @@ impl Transport { } } - async fn recv( + async fn recv_inner( transport: Arc, mut server_stdout: Box, client_tx: UnboundedSender, - ) { + ) -> Result<()> { let mut recv_buffer = String::new(); loop { - match Self::recv_server_message(&mut server_stdout, &mut recv_buffer).await { - Ok(msg) => { - transport - .process_server_message(&client_tx, msg) - .await - .unwrap(); - } - Err(err) => { - error!("err: <- {:?}", err); - break; - } - } + let msg = Self::recv_server_message(&mut server_stdout, &mut recv_buffer).await?; + transport.process_server_message(&client_tx, msg).await?; } } - async fn send( + async fn recv( + transport: Arc, + server_stdout: Box, + client_tx: UnboundedSender, + ) { + if let Err(err) = Self::recv_inner(transport, server_stdout, client_tx).await { + error!("err: <- {:?}", err); + } + } + + async fn send_inner( transport: Arc, mut server_stdin: Box, mut client_rx: UnboundedReceiver, - ) { + ) -> Result<()> { while let Some(payload) = client_rx.recv().await { transport .send_payload_to_server(&mut server_stdin, payload) - .await - .unwrap() + .await?; + } + Ok(()) + } + + async fn send( + transport: Arc, + server_stdin: Box, + client_rx: UnboundedReceiver, + ) { + if let Err(err) = Self::send_inner(transport, server_stdin, client_rx).await { + error!("err: <- {:?}", err); } } diff --git a/helix-view/src/handlers/dap.rs b/helix-view/src/handlers/dap.rs index 107c29be578c..3da01494d010 100644 --- a/helix-view/src/handlers/dap.rs +++ b/helix-view/src/handlers/dap.rs @@ -321,6 +321,7 @@ impl Editor { } } None => { + self.debugger = None; self.set_status( "Terminated debugging session and disconnected debugger.", ); From a333f6fed7d11c03f9277ea4fdf58617b8818ebc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:04:48 +0900 Subject: [PATCH 28/44] build(deps): bump etcetera from 0.4.0 to 0.5.0 (#6798) Bumps [etcetera](https://github.com/lunacookies/etcetera) from 0.4.0 to 0.5.0. - [Release notes](https://github.com/lunacookies/etcetera/releases) - [Commits](https://github.com/lunacookies/etcetera/commits) --- updated-dependencies: - dependency-name: etcetera dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- helix-core/Cargo.toml | 2 +- helix-loader/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 472b3152a463..3cf7b7e94191 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,12 +384,12 @@ dependencies = [ [[package]] name = "etcetera" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d017fce18e4e9bfa75e1db51f49f4487bd3f8a7df509b24a46474a956ee962fd" +checksum = "870a9fdff9c99141df9277dece5ec8021434eca50f05cbac41a5eb07c9659e7d" dependencies = [ "cfg-if", - "dirs-next", + "home", "thiserror", ] diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 887a83cfcc8b..99776694e4a1 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -45,7 +45,7 @@ encoding_rs = "0.8" chrono = { version = "0.4", default-features = false, features = ["alloc", "std"] } -etcetera = "0.4" +etcetera = "0.5" textwrap = "0.16.0" [dev-dependencies] diff --git a/helix-loader/Cargo.toml b/helix-loader/Cargo.toml index 9225ad1a2235..4cc3e18660af 100644 --- a/helix-loader/Cargo.toml +++ b/helix-loader/Cargo.toml @@ -17,7 +17,7 @@ path = "src/main.rs" anyhow = "1" serde = { version = "1.0", features = ["derive"] } toml = "0.7" -etcetera = "0.4" +etcetera = "0.5" tree-sitter = "0.20" once_cell = "1.17" log = "0.4" From 3f72792033e6a49880595172a5235bb55ca6805f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:05:03 +0900 Subject: [PATCH 29/44] build(deps): bump serde_json from 1.0.95 to 1.0.96 (#6799) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.95 to 1.0.96. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.95...v1.0.96) --- 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 3cf7b7e94191..e13524ba26a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1822,9 +1822,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", From 6f972e5da2de1d532fbcd0c9e8b0a6378fbb9c15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:05:31 +0900 Subject: [PATCH 30/44] build(deps): bump serde from 1.0.159 to 1.0.160 (#6800) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.159 to 1.0.160. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.159...v1.0.160) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e13524ba26a6..2c9b92271e6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1802,18 +1802,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", From 2ccb5b75d0a310b90b5cc453915281560ba1f220 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:06:08 +0900 Subject: [PATCH 31/44] build(deps): bump libloading from 0.7.4 to 0.8.0 (#6801) Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.7.4 to 0.8.0. - [Release notes](https://github.com/nagisa/rust_libloading/releases) - [Commits](https://github.com/nagisa/rust_libloading/compare/0.7.4...0.8.0) --- updated-dependencies: - dependency-name: libloading dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 88 +++++++++++++++++++++++++++++++++++------ helix-loader/Cargo.toml | 2 +- 2 files changed, 78 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c9b92271e6d..470f41b44dd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -359,7 +359,7 @@ checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" dependencies = [ "errno-dragonfly", "libc", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -420,7 +420,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall 0.2.16", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1399,7 +1399,7 @@ checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" dependencies = [ "hermit-abi 0.3.1", "libc", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1431,12 +1431,12 @@ checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1525,7 +1525,7 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1614,7 +1614,7 @@ dependencies = [ "libc", "redox_syscall 0.2.16", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1770,7 +1770,7 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -2000,7 +2000,7 @@ dependencies = [ "fastrand", "redox_syscall 0.3.5", "rustix", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -2131,7 +2131,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -2427,6 +2427,15 @@ dependencies = [ "windows-targets 0.42.2", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -2457,6 +2466,21 @@ dependencies = [ "windows_x86_64_msvc 0.47.0", ] +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -2469,6 +2493,12 @@ version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831d567d53d4f3cb1db332b68e6e2b6260228eb4d99a777d8b2e8ed794027c90" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -2481,6 +2511,12 @@ version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a42d54a417c60ce4f0e31661eed628f0fa5aca73448c093ec4d45fab4c51cdf" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -2493,6 +2529,12 @@ version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1925beafdbb22201a53a483db861a5644123157c1c3cee83323a2ed565d71e3" +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -2505,6 +2547,12 @@ version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a8ef8f2f1711b223947d9b69b596cf5a4e452c930fb58b6fc3fdae7d0ec6b31" +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -2517,6 +2565,12 @@ version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7acaa0c2cf0d2ef99b61c308a0c3dbae430a51b7345dedec470bd8f53f5a3642" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -2529,6 +2583,12 @@ version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5a0628f71be1d11e17ca4a0e9e15b3a5180f6fbf1c2d55e3ba3f850378052c1" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -2541,6 +2601,12 @@ version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d6e62c256dc6d40b8c8707df17df8d774e60e39db723675241e7c15e910bce7" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "winnow" version = "0.4.1" diff --git a/helix-loader/Cargo.toml b/helix-loader/Cargo.toml index 4cc3e18660af..31cfbf62d733 100644 --- a/helix-loader/Cargo.toml +++ b/helix-loader/Cargo.toml @@ -29,4 +29,4 @@ cc = { version = "1" } threadpool = { version = "1.0" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -libloading = "0.7" +libloading = "0.8" From ca65d312e715413cd5675cafd599d74534900d3f Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 18 Apr 2023 03:10:19 +0200 Subject: [PATCH 32/44] always build grammars with c++14 and c11 (#6792) --- Cargo.lock | 1 + helix-loader/Cargo.toml | 1 + helix-loader/src/grammar.rs | 48 +++++++++++++++++++++++++++++++------ 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 470f41b44dd8..38b10fce4b73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1134,6 +1134,7 @@ dependencies = [ "log", "once_cell", "serde", + "tempfile", "threadpool", "toml", "tree-sitter", diff --git a/helix-loader/Cargo.toml b/helix-loader/Cargo.toml index 31cfbf62d733..60b1e911be38 100644 --- a/helix-loader/Cargo.toml +++ b/helix-loader/Cargo.toml @@ -27,6 +27,7 @@ log = "0.4" # cloning/compiling tree-sitter grammars cc = { version = "1" } threadpool = { version = "1.0" } +tempfile = "3.5.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] libloading = "0.8" diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index 2eb59a38e150..3697ec7e15bd 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -8,6 +8,7 @@ use std::{ process::Command, sync::mpsc::channel, }; +use tempfile::TempPath; use tree_sitter::Language; #[cfg(unix)] @@ -446,13 +447,17 @@ fn build_tree_sitter_library( command.env(key, value); } command.args(compiler.args()); + // used to delay dropping the temporary object file until after the compilation is complete + let _path_guard; if cfg!(all(windows, target_env = "msvc")) { command .args(["/nologo", "/LD", "/I"]) .arg(header_path) .arg("/Od") - .arg("/utf-8"); + .arg("/utf-8") + .arg("/std:c++14") + .arg("/std:c11"); if let Some(scanner_path) = scanner_path.as_ref() { command.arg(scanner_path); } @@ -466,20 +471,49 @@ fn build_tree_sitter_library( .arg("-shared") .arg("-fPIC") .arg("-fno-exceptions") - .arg("-g") .arg("-I") .arg(header_path) .arg("-o") - .arg(&library_path) - .arg("-O3"); + .arg(&library_path); + if let Some(scanner_path) = scanner_path.as_ref() { if scanner_path.extension() == Some("c".as_ref()) { - command.arg("-xc").arg("-std=c99").arg(scanner_path); + command.arg("-xc").arg("-std=c11").arg(scanner_path); } else { - command.arg(scanner_path); + let mut cpp_command = Command::new(compiler.path()); + cpp_command.current_dir(src_path); + for (key, value) in compiler.env() { + cpp_command.env(key, value); + } + cpp_command.args(compiler.args()); + let object_file = + library_path.with_file_name(format!("{}_scanner.o", &grammar.grammar_id)); + cpp_command + .arg("-fPIC") + .arg("-fno-exceptions") + .arg("-I") + .arg(header_path) + .arg("-o") + .arg(&object_file) + .arg("-std=c++14") + .arg("-c") + .arg(scanner_path); + let output = cpp_command + .output() + .context("Failed to execute C++ compiler")?; + if !output.status.success() { + return Err(anyhow!( + "Parser compilation failed.\nStdout: {}\nStderr: {}", + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr) + )); + } + + command.arg(&object_file); + _path_guard = TempPath::from_path(object_file); } } - command.arg("-xc").arg(parser_path); + command.arg("-xc").arg("-std=c11").arg(parser_path); if cfg!(all( unix, not(any(target_os = "macos", target_os = "illumos")) From 4f03c03556aacc43306152d43aa815b2527a630f Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Wed, 19 Apr 2023 04:51:15 +0530 Subject: [PATCH 33/44] update tree-sitter-markdown (#6785) * chore: fix bump tree-sitter-markdown Signed-off-by: Lakshya Singh * chore: bump markdown_inline to latest rev Signed-off-by: Lakshya Singh --------- Signed-off-by: Lakshya Singh --- languages.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 8a0aa66120cb..dc4d10238186 100644 --- a/languages.toml +++ b/languages.toml @@ -1126,7 +1126,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "markdown" -source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "7e7aa9a25ca9729db9fe22912f8f47bdb403a979", subpath = "tree-sitter-markdown" } +source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "fa6bfd51727e4bef99f7eec5f43947f73d64ea7d", subpath = "tree-sitter-markdown" } [[language]] name = "markdown.inline" @@ -1138,7 +1138,7 @@ grammar = "markdown_inline" [[grammar]] name = "markdown_inline" -source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "7e7aa9a25ca9729db9fe22912f8f47bdb403a979", subpath = "tree-sitter-markdown-inline" } +source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "fa6bfd51727e4bef99f7eec5f43947f73d64ea7d", subpath = "tree-sitter-markdown-inline" } [[language]] name = "dart" From 83c307a66a05644c95c3864b3a79293d92f0b176 Mon Sep 17 00:00:00 2001 From: David Else <12832280+David-Else@users.noreply.github.com> Date: Wed, 19 Apr 2023 22:56:18 +0000 Subject: [PATCH 34/44] Improve and update the installation documentation (#6809) --- book/src/install.md | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/book/src/install.md b/book/src/install.md index 5f1651ae9945..169e6e0b6996 100644 --- a/book/src/install.md +++ b/book/src/install.md @@ -41,8 +41,6 @@ line. ## Linux, macOS, Windows and OpenBSD packaging status -Helix is available for Linux, macOS and Windows via the official repositories listed below. - [![Packaging status](https://repology.org/badge/vertical-allrepos/helix.svg)](https://repology.org/project/helix/versions) ## Linux @@ -51,7 +49,7 @@ The following third party repositories are available: ### Ubuntu -Helix is available via [Maveonair's PPA](https://launchpad.net/~maveonair/+archive/ubuntu/helix-editor): +Add the `PPA` for Helix: ```sh sudo add-apt-repository ppa:maveonair/helix-editor @@ -61,7 +59,7 @@ sudo apt install helix ### Fedora/RHEL -Helix is available via `copr`: +Enable the `COPR` repository for Helix: ```sh sudo dnf copr enable varlad/helix @@ -92,8 +90,8 @@ If you are using a version of Nix without flakes enabled, ### AppImage -Install Helix using [AppImage](https://appimage.org/). -Download Helix AppImage from the [latest releases](https://github.com/helix-editor/helix/releases/latest) page. +Install Helix using the Linux [AppImage](https://appimage.org/) format. +Download the official Helix AppImage from the [latest releases](https://github.com/helix-editor/helix/releases/latest) page. ```sh chmod +x helix-*.AppImage # change permission for executable mode @@ -143,33 +141,37 @@ pacman -S mingw-w64-ucrt-x86_64-helix ## Building from source -Clone the repository: +Requirements: + +- The [Rust toolchain](https://www.rust-lang.org/tools/install) +- The [Git version control system](https://git-scm.com/) +- A c++14 compatible compiler to build the tree-sitter grammars, for example GCC or Clang + +If you are using the `musl-libc` standard library instead of `glibc` the following environment variable must be set during the build to ensure tree-sitter grammars can be loaded correctly: + +```sh +RUSTFLAGS="-C target-feature=-crt-static" +``` + +1. Clone the repository: ```sh git clone https://github.com/helix-editor/helix cd helix ``` -Compile from source: +2. Compile from source: ```sh cargo install --path helix-term --locked ``` This command will create the `hx` executable and construct the tree-sitter -grammars in the local `runtime` folder. To build the tree-sitter grammars requires -a c++ compiler to be installed, for example `gcc-c++`. - -> 💡 If you are using the musl-libc instead of glibc the following environment variable must be set during the build -> to ensure tree-sitter grammars can be loaded correctly: -> -> ```sh -> RUSTFLAGS="-C target-feature=-crt-static" -> ``` +grammars in the local `runtime` folder. > 💡 Tree-sitter grammars can be fetched and compiled if not pre-packaged. Fetch -> grammars with `hx --grammar fetch` (requires `git`) and compile them with -> `hx --grammar build` (requires a C++ compiler). This will install them in +> grammars with `hx --grammar fetch` and compile them with +> `hx --grammar build`. This will install them in > the `runtime` directory within the user's helix config directory (more > [details below](#multiple-runtime-directories)). From f5d38cee17e78bf82eb2d0b3070aa9cd52c0a741 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Thu, 20 Apr 2023 07:53:16 +0200 Subject: [PATCH 35/44] produce error when grammar build fails (#6795) * produce error when grammar build fails * print which grammar build failed --- helix-loader/src/grammar.rs | 59 ++++++++++++++----------------------- 1 file changed, 22 insertions(+), 37 deletions(-) diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index 3697ec7e15bd..a5dcc4c8a12a 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -1,4 +1,4 @@ -use anyhow::{anyhow, Context, Result}; +use anyhow::{anyhow, bail, Context, Result}; use serde::{Deserialize, Serialize}; use std::fs; use std::time::SystemTime; @@ -98,15 +98,12 @@ pub fn fetch_grammars() -> Result<()> { let mut git_up_to_date = 0; let mut non_git = Vec::new(); - for res in results { + for (grammar_id, res) in results { match res { Ok(FetchStatus::GitUpToDate) => git_up_to_date += 1, - Ok(FetchStatus::GitUpdated { - grammar_id, - revision, - }) => git_updated.push((grammar_id, revision)), - Ok(FetchStatus::NonGit { grammar_id }) => non_git.push(grammar_id), - Err(e) => errors.push(e), + Ok(FetchStatus::GitUpdated { revision }) => git_updated.push((grammar_id, revision)), + Ok(FetchStatus::NonGit) => non_git.push(grammar_id), + Err(e) => errors.push((grammar_id, e)), } } @@ -138,10 +135,10 @@ pub fn fetch_grammars() -> Result<()> { if !errors.is_empty() { let len = errors.len(); - println!("{} grammars failed to fetch", len); - for (i, error) in errors.into_iter().enumerate() { - println!("\tFailure {}/{}: {}", i + 1, len, error); + for (i, (grammar, error)) in errors.into_iter().enumerate() { + println!("Failure {}/{len}: {grammar} {error}", i + 1); } + bail!("{len} grammars failed to fetch"); } Ok(()) @@ -158,11 +155,11 @@ pub fn build_grammars(target: Option) -> Result<()> { let mut already_built = 0; let mut built = Vec::new(); - for res in results { + for (grammar_id, res) in results { match res { Ok(BuildStatus::AlreadyBuilt) => already_built += 1, - Ok(BuildStatus::Built { grammar_id }) => built.push(grammar_id), - Err(e) => errors.push(e), + Ok(BuildStatus::Built) => built.push(grammar_id), + Err(e) => errors.push((grammar_id, e)), } } @@ -179,10 +176,10 @@ pub fn build_grammars(target: Option) -> Result<()> { if !errors.is_empty() { let len = errors.len(); - println!("{} grammars failed to build", len); - for (i, error) in errors.into_iter().enumerate() { - println!("\tFailure {}/{}: {}", i, len, error); + for (i, (grammar_id, error)) in errors.into_iter().enumerate() { + println!("Failure {}/{len}: {grammar_id} {error}", i + 1); } + bail!("{len} grammars failed to build"); } Ok(()) @@ -214,7 +211,7 @@ fn get_grammar_configs() -> Result> { Ok(grammars) } -fn run_parallel(grammars: Vec, job: F) -> Vec> +fn run_parallel(grammars: Vec, job: F) -> Vec<(String, Result)> where F: Fn(GrammarConfiguration) -> Result + Send + 'static + Clone, Res: Send + 'static, @@ -229,7 +226,7 @@ where pool.execute(move || { // Ignore any SendErrors, if any job in another thread has encountered an // error the Receiver will be closed causing this send to fail. - let _ = tx.send(job(grammar)); + let _ = tx.send((grammar.grammar_id.clone(), job(grammar))); }); } @@ -240,13 +237,8 @@ where enum FetchStatus { GitUpToDate, - GitUpdated { - grammar_id: String, - revision: String, - }, - NonGit { - grammar_id: String, - }, + GitUpdated { revision: String }, + NonGit, } fn fetch_grammar(grammar: GrammarConfiguration) -> Result { @@ -287,17 +279,12 @@ fn fetch_grammar(grammar: GrammarConfiguration) -> Result { )?; git(&grammar_dir, ["checkout", &revision])?; - Ok(FetchStatus::GitUpdated { - grammar_id: grammar.grammar_id, - revision, - }) + Ok(FetchStatus::GitUpdated { revision }) } else { Ok(FetchStatus::GitUpToDate) } } else { - Ok(FetchStatus::NonGit { - grammar_id: grammar.grammar_id, - }) + Ok(FetchStatus::NonGit) } } @@ -347,7 +334,7 @@ where enum BuildStatus { AlreadyBuilt, - Built { grammar_id: String }, + Built, } fn build_grammar(grammar: GrammarConfiguration, target: Option<&str>) -> Result { @@ -533,9 +520,7 @@ fn build_tree_sitter_library( )); } - Ok(BuildStatus::Built { - grammar_id: grammar.grammar_id, - }) + Ok(BuildStatus::Built) } fn needs_recompile( From b336cd76a740eea6ea41baa1028233ccf6e12ee5 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Thu, 20 Apr 2023 07:53:38 +0200 Subject: [PATCH 36/44] update dependencies (#6808) --- Cargo.lock | 137 ++++++++++++++++------------------------------------- 1 file changed, 40 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38b10fce4b73..f413bc41f011 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,9 +197,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "crc32fast" @@ -260,7 +260,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.11", + "syn 2.0.15", ] [[package]] @@ -277,7 +277,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.11", + "syn 2.0.15", ] [[package]] @@ -353,13 +353,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -413,14 +413,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" dependencies = [ "cfg-if", "libc", "redox_syscall 0.2.16", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -495,9 +495,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "libc", @@ -721,9 +721,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0c5a9f4d621d4f4ea046bb331df5c746ca735b8cae5b234cc2be70ee4dbef0" +checksum = "2a258595457bc192d1f1c59d0d168a1e34e2be9b97a614e14995416185de41a7" dependencies = [ "hex", "thiserror", @@ -731,9 +731,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9609c1b8f36f12968e6a6098f7cdb52004f7d42d570f47a2d6d7c16612f19acb" +checksum = "e4e55e40dfd694884f0eb78796c5bddcf2f8b295dace47039099dd7e76534973" dependencies = [ "gix-hash", "hashbrown 0.13.2", @@ -912,9 +912,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12fc4bbc3161a5b2d68079fce93432cef8771ff88ca017abb01187fddfc41a1" +checksum = "3c6f6ff53f888858afc24bf12628446a14279ceec148df6194481f306f553ad2" dependencies = [ "bstr", "gix-date", @@ -1298,16 +1298,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.55" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "716f12fbcfac6ffab0a5e9ec51d0a0ff70503742bb2dc7b99396394c9dc323f0" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.47.0", + "windows 0.48.0", ] [[package]] @@ -1394,13 +1394,13 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" dependencies = [ "hermit-abi 0.3.1", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1451,9 +1451,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" [[package]] name = "lock_api" @@ -1638,9 +1638,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "proc-macro2" -version = "1.0.54" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -1762,16 +1762,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.5" +version = "0.37.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e78cc525325c06b4a7ff02db283472f3c042b7ff0c391f96c6d5ac6f4f91b75" +checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77" dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1818,7 +1818,7 @@ checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.11", + "syn 2.0.15", ] [[package]] @@ -1840,7 +1840,7 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.11", + "syn 2.0.15", ] [[package]] @@ -1982,9 +1982,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.11" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e3787bb71465627110e7d87ed4faaa36c1f61042ee67badb9e2ef173accc40" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", @@ -2050,7 +2050,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.11", + "syn 2.0.15", ] [[package]] @@ -2143,7 +2143,7 @@ checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.11", + "syn 2.0.15", ] [[package]] @@ -2412,11 +2412,11 @@ dependencies = [ [[package]] name = "windows" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2649ff315bee4c98757f15dac226efe3d81927adbb6e882084bb1ee3e0c330a7" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.47.0", + "windows-targets 0.48.0", ] [[package]] @@ -2452,21 +2452,6 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-targets" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f8996d3f43b4b2d44327cd71b7b0efd1284ab60e6e9d0e8b630e18555d87d3e" -dependencies = [ - "windows_aarch64_gnullvm 0.47.0", - "windows_aarch64_msvc 0.47.0", - "windows_i686_gnu 0.47.0", - "windows_i686_msvc 0.47.0", - "windows_x86_64_gnu 0.47.0", - "windows_x86_64_gnullvm 0.47.0", - "windows_x86_64_msvc 0.47.0", -] - [[package]] name = "windows-targets" version = "0.48.0" @@ -2488,12 +2473,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831d567d53d4f3cb1db332b68e6e2b6260228eb4d99a777d8b2e8ed794027c90" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" @@ -2506,12 +2485,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" -[[package]] -name = "windows_aarch64_msvc" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a42d54a417c60ce4f0e31661eed628f0fa5aca73448c093ec4d45fab4c51cdf" - [[package]] name = "windows_aarch64_msvc" version = "0.48.0" @@ -2524,12 +2497,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" -[[package]] -name = "windows_i686_gnu" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1925beafdbb22201a53a483db861a5644123157c1c3cee83323a2ed565d71e3" - [[package]] name = "windows_i686_gnu" version = "0.48.0" @@ -2542,12 +2509,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" -[[package]] -name = "windows_i686_msvc" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8ef8f2f1711b223947d9b69b596cf5a4e452c930fb58b6fc3fdae7d0ec6b31" - [[package]] name = "windows_i686_msvc" version = "0.48.0" @@ -2560,12 +2521,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" -[[package]] -name = "windows_x86_64_gnu" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acaa0c2cf0d2ef99b61c308a0c3dbae430a51b7345dedec470bd8f53f5a3642" - [[package]] name = "windows_x86_64_gnu" version = "0.48.0" @@ -2578,12 +2533,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a0628f71be1d11e17ca4a0e9e15b3a5180f6fbf1c2d55e3ba3f850378052c1" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" @@ -2596,12 +2545,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" -[[package]] -name = "windows_x86_64_msvc" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6e62c256dc6d40b8c8707df17df8d774e60e39db723675241e7c15e910bce7" - [[package]] name = "windows_x86_64_msvc" version = "0.48.0" From 13cc44c65e5037141b52f4a1b5fc66d7db100d25 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Fri, 21 Apr 2023 05:49:27 +0200 Subject: [PATCH 37/44] fix windows build (#6834) --- helix-loader/src/grammar.rs | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index a5dcc4c8a12a..3dac237c8c41 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -443,10 +443,42 @@ fn build_tree_sitter_library( .arg(header_path) .arg("/Od") .arg("/utf-8") - .arg("/std:c++14") .arg("/std:c11"); if let Some(scanner_path) = scanner_path.as_ref() { - command.arg(scanner_path); + if scanner_path.extension() == Some("c".as_ref()) { + command.arg(scanner_path); + } else { + let mut cpp_command = Command::new(compiler.path()); + cpp_command.current_dir(src_path); + for (key, value) in compiler.env() { + cpp_command.env(key, value); + } + cpp_command.args(compiler.args()); + let object_file = + library_path.with_file_name(format!("{}_scanner.o", &grammar.grammar_id)); + cpp_command + .args(["/nologo", "/LD", "/I"]) + .arg(header_path) + .arg("/Od") + .arg("/utf-8") + .arg("/std:c++14") + .arg("/o") + .arg(&object_file) + .arg("/c") + .arg(scanner_path); + let output = cpp_command + .output() + .context("Failed to execute C++ compiler")?; + if !output.status.success() { + return Err(anyhow!( + "Parser compilation failed.\nStdout: {}\nStderr: {}", + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr) + )); + } + command.arg(&object_file); + _path_guard = TempPath::from_path(object_file); + } } command From c3e2db77f7d1d268856e0c3cba328e9fbd0cc71f Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Fri, 21 Apr 2023 05:50:37 +0200 Subject: [PATCH 38/44] flip symbol range in LSP goto commands (#6794) --- helix-term/src/commands/lsp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 7a26b3cf6024..be8ae02a630a 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -205,7 +205,9 @@ fn jump_to_location( log::warn!("lsp position out of bounds - {:?}", location.range); return; }; - doc.set_selection(view.id, Selection::single(new_range.anchor, new_range.head)); + // we flip the range so that the cursor sits on the start of the symbol + // (for example start of the function). + doc.set_selection(view.id, Selection::single(new_range.head, new_range.anchor)); align_view(doc, view, Align::Center); } From 5aedf11493d83c97cd2cad1d1ac0488b9d1f5f36 Mon Sep 17 00:00:00 2001 From: Ollie Charles Date: Fri, 21 Apr 2023 04:51:17 +0100 Subject: [PATCH 39/44] Replace `*.cabal` in Haskell `roots` with `cabal.project` (#6828) `roots` doesn't support wildcards. As such this root is dropped, and `cabal.project` is added, which is probably the best we can do for Cabal-based projects for now. --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index dc4d10238186..953a23fcdd85 100644 --- a/languages.toml +++ b/languages.toml @@ -875,7 +875,7 @@ name = "haskell" scope = "source.haskell" injection-regex = "haskell" file-types = ["hs", "hs-boot"] -roots = ["Setup.hs", "stack.yaml", "*.cabal"] +roots = ["Setup.hs", "stack.yaml", "cabal.project"] comment-token = "--" language-server = { command = "haskell-language-server-wrapper", args = ["--lsp"] } indent = { tab-width = 2, unit = " " } From 234280736491747b54562e636565960b23092963 Mon Sep 17 00:00:00 2001 From: Chirikumbrah <78883260+Chirikumbrah@users.noreply.github.com> Date: Fri, 21 Apr 2023 06:51:47 +0300 Subject: [PATCH 40/44] another refactoring of dracula theme (#6767) --- runtime/themes/dracula.toml | 169 +++++++++++++++++------------------- 1 file changed, 80 insertions(+), 89 deletions(-) diff --git a/runtime/themes/dracula.toml b/runtime/themes/dracula.toml index f1d895f9d6d6..bfdd620d03c4 100644 --- a/runtime/themes/dracula.toml +++ b/runtime/themes/dracula.toml @@ -1,75 +1,65 @@ # Author : Sebastian Zivota # Author : Chirikumbrah -"annotation" = { fg = "white" } -"attribute" = { fg = "cyan" } -"comment" = { fg = "comment" } -"constant" = { fg = "purple" } -"constant.numeric" = { fg = "orange" } -"constant.builtin" = { fg = "orange" } -"constant.character.escape" = { fg = "pink" } -"constant.macro" = { fg = "purple" } -"constructor" = { fg = "cyan" } -"conditional" = { fg = "pink" } -"character" = { fg = "purple" } -"definition".underline = { sp = "cyan" } -"field.key" = { fg = "purple" } -"field" = { fg = "purple" } -"function" = { fg = "green" } -"function.builtin" = { fg = "green" } -"function.method" = { fg = "green" } -"function.macro" = { fg = "purple" } -"function.call" = { fg = "green" } -"keyword" = { fg = "pink" } -"keyword.operator" = { fg = "pink" } -"keyword.function" = { fg = "pink" } -"keyword.return" = { fg = "pink" } -"keyword.control.import" = { fg = "green" } -"keyword.directive" = { fg = "green" } -"keyword.control.repeat" = { fg = "cyan" } -"keyword.control.exception" = { fg = "purple" } -"keyword.storage.type" = { fg = "cyan" } -"keyword.storage.modifier" = { fg = "cyan" } -"method.call" = { fg = "green" } -"reference" = { fg = "grey" } -"special" = { fg = "orange" } -"symbol" = { fg = "yellow" } -"tag.attribute" = { fg = "purple" } -"tag.delimiter" = { fg = "white" } -"operator" = { fg = "pink" } -"label" = { fg = "cyan" } -"punctuation" = { fg = "white" } -"punctuation.bracket" = { fg = "white" } -"punctuation.delimiter" = { fg = "white" } -"punctuation.special" = { fg = "purple" } -"string" = { fg = "yellow" } -"string.regexp" = { fg = "cyan" } -"string.escape" = { fg = "cyan" } -"string.special" = { fg = "cyan" } -"tag" = { fg = "pink" } -"text" = { fg = "grey" } -"text.strong" = { modifiers = "bold" } -"text.emphasis" = { fg = "orange" } -"text.strike" = { fg = "white" } -"text.literal" = { fg = "orange" } -"text.uri".underline = { fg = "orange" } -"type.builtin" = { fg = "cyan", modifiers = ["italic"] } -"type" = { fg = "cyan", modifiers = ["italic"] } -"type.enum.variant" = { fg = "white", modifiers = ["italic"] } -"property" = { fg = "purple" } -"structure" = { fg = "purple" } -"scope" = { modifiers = "bold" } -"variable" = { fg = "purple" } -"variable.builtin" = { fg = "orange", modifiers = ["italic"] } -"variable.parameter" = { fg = "purple", modifiers = ["italic"] } -"parameter" = { fg = "orange" } +"annotation" = { fg = "foreground" } +"attribute" = { fg = "green", modifiers = ["italic"] } +"comment" = { fg = "comment" } +"comment.block.documentation" = { fg = "comment" } +"comment.block" = { fg = "comment" } +"comment.line" = { fg = "comment" } +"constant" = { fg = "purple" } +"constant.numeric" = { fg = "purple" } +"constant.builtin" = { fg = "purple" } +"constant.builtin.boolean" = { fg = "purple" } +"constant.character" = { fg = "cyan" } +"constant.character.escape" = { fg = "pink" } +"constant.macro" = { fg = "purple" } +"constructor" = { fg = "purple" } +"function" = { fg = "green" } +"function.builtin" = { fg = "green" } +"function.method" = { fg = "green" } +"function.macro" = { fg = "purple" } +"function.call" = { fg = "green" } +"keyword" = { fg = "pink" } +"keyword.operator" = { fg = "pink" } +"keyword.function" = { fg = "pink" } +"keyword.return" = { fg = "pink" } +"keyword.control.import" = { fg = "pink" } +"keyword.directive" = { fg = "green" } +"keyword.control.repeat" = { fg = "pink" } +"keyword.control.conditional" = { fg = "pink" } +"keyword.control.exception" = { fg = "purple" } +"keyword.storage" = { fg = "pink" } +"keyword.storage.type" = { fg = "cyan", modifiers = ["italic"] } +"keyword.storage.modifier" = { fg = "pink" } +"tag" = { fg = "pink" } +"tag.attribute" = { fg = "purple" } +"tag.delimiter" = { fg = "foreground" } +"label" = { fg = "cyan" } +"punctuation" = { fg = "foreground" } +"punctuation.bracket" = { fg = "foreground" } +"punctuation.delimiter" = { fg = "foreground" } +"punctuation.special" = { fg = "pink" } +"special" = { fg = "pink" } +"string" = { fg = "yellow" } +"string.special" = { fg = "orange" } +"string.symbol" = { fg = "yellow" } +"string.regexp" = { fg = "red" } +"type.builtin" = { fg = "cyan" } +"type" = { fg = "cyan", modifiers = ["italic"] } +"type.enum.variant" = { fg = "foreground", modifiers = ["italic"] } +"variable" = { fg = "foreground" } +"variable.builtin" = { fg = "purple", modifiers = ["italic"] } +"variable.parameter" = { fg = "orange", modifiers = ["italic"] } +"variable.other" = { fg = "cyan" } +"variable.other.member" = { fg = "purple" } "diff.plus" = { fg = "green" } "diff.delta" = { fg = "orange" } "diff.minus" = { fg = "red" } -"ui.background" = { fg = "white", bg = "background" } -"ui.cursor.match" = { fg = "white", bg = "grey" } +"ui.background" = { fg = "foreground", bg = "background" } +"ui.cursor.match" = { fg = "foreground", bg = "grey" } "ui.cursor" = { fg = "background", bg = "purple", modifiers = ["dim"] } "ui.cursor.normal" = { fg = "background", bg = "purple", modifiers = ["dim"] } "ui.cursor.insert" = { fg = "background", bg = "green", modifiers = ["dim"] } @@ -78,24 +68,24 @@ "ui.cursor.primary.insert" = { fg = "background", bg = "green" } "ui.cursor.primary.select" = { fg = "background", bg = "cyan" } "ui.cursorline.primary" = { bg = "cursorline" } -"ui.help" = { fg = "white", bg = "black" } +"ui.help" = { fg = "foreground", bg = "black" } "ui.debug" = { fg = "red" } "ui.highlight.frameline" = { fg = "background", bg = "red" } "ui.linenr" = { fg = "comment" } -"ui.linenr.selected" = { fg = "white" } -"ui.menu" = { fg = "white", bg = "black" } +"ui.linenr.selected" = { fg = "foreground" } +"ui.menu" = { fg = "foreground", bg = "black" } "ui.menu.selected" = { fg = "cyan", bg = "black" } -"ui.popup" = { fg = "white", bg = "black" } +"ui.popup" = { fg = "foreground", bg = "black" } "ui.selection.primary" = { bg = "selection_primary" } "ui.selection" = { bg = "selection" } -"ui.statusline" = { fg = "white", bg = "darker" } +"ui.statusline" = { fg = "foreground", bg = "darker" } "ui.statusline.inactive" = { fg = "comment", bg = "darker" } "ui.statusline.normal" = { fg = "black", bg = "purple" } "ui.statusline.insert" = { fg = "black", bg = "green" } "ui.statusline.select" = { fg = "black", bg = "cyan" } -"ui.text" = { fg = "white" } +"ui.text" = { fg = "foreground" } "ui.text.focus" = { fg = "cyan" } -"ui.window" = { fg = "white" } +"ui.window" = { fg = "foreground" } "ui.virtual.whitespace" = { fg = "subtle" } "ui.virtual.wrap" = { fg = "subtle" } "ui.virtual.ruler" = { bg = "black" } @@ -114,29 +104,30 @@ "markup.link.url" = { fg = "cyan" } "markup.link.text" = { fg = "pink" } "markup.quote" = { fg = "yellow", modifiers = ["italic"] } -"markup.raw" = { fg = "white" } +"markup.raw" = { fg = "foreground" } "diagnostic" = { underline = { color = "orange", style = "curl" } } "diagnostic.hint" = { underline = { color = "purple", style = "curl" } } "diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } "diagnostic.error" = { underline = { color = "red", style = "curl" } } "diagnostic.info" = { underline = { color = "cyan", style = "curl" } } +"definition" = { underline = { color = "cyan" } } [palette] -background = "#282A36" -cursorline = "#2d303e" -darker = "#222430" -black = "#191A21" -grey = "#666771" -comment = "#6272A4" -selection_primary = "#44475a" -selection = "#363848" -subtle = "#424450" -white = "#f8f8f2" -red = "#ff5555" -orange = "#ffb86c" -yellow = "#f1fa8c" -green = "#50fa7b" -purple = "#BD93F9" -cyan = "#8be9fd" -pink = "#ff79c6" +foreground = "#f8f8f2" +background = "#282A36" +cursorline = "#2d303e" +darker = "#222430" +black = "#191A21" +grey = "#666771" +comment = "#6272A4" +selection_primary = "#44475a" +selection = "#363848" +subtle = "#424450" +red = "#ff5555" +orange = "#ffb86c" +yellow = "#f1fa8c" +green = "#50fa7b" +purple = "#BD93F9" +cyan = "#8be9fd" +pink = "#ff79c6" From 78088ac18510754c9aac27c162e4d81890a11a82 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 21 Apr 2023 05:53:04 +0200 Subject: [PATCH 41/44] Ayu dark improvements (#6622) * theme(ayu_dark): Differentiate primary cursor * theme(ayu_dark): Color statusline mode field * theme(ayu): Adapt other ayu themes as well --- runtime/themes/ayu_dark.toml | 6 +++++- runtime/themes/ayu_light.toml | 6 +++++- runtime/themes/ayu_mirage.toml | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/runtime/themes/ayu_dark.toml b/runtime/themes/ayu_dark.toml index 1e1aab91eaaa..0b011b0eaf2f 100644 --- a/runtime/themes/ayu_dark.toml +++ b/runtime/themes/ayu_dark.toml @@ -36,11 +36,15 @@ # Interface "ui.background"= { bg = "background" } -"ui.cursor" = { fg = "dark_gray", bg = "orange" } +"ui.cursor" = { fg = "dark_gray", bg = "yellow" } +"ui.cursor.primary" = { fg = "dark_gray", bg = "orange" } "ui.cursor.match" = "orange" "ui.linenr" = "dark_gray" "ui.linenr.selected" = "gray" "ui.statusline" = { fg = "foreground", bg = "black" } +"ui.statusline.normal" = { fg = "black", bg = "blue" } +"ui.statusline.insert" = { fg = "black", bg = "orange" } +"ui.statusline.select" = { fg = "black", bg = "magenta" } "ui.cursorline" = { bg = "black" } "ui.popup" = { fg = "#7B91b3", bg = "black" } "ui.window" = "dark_gray" diff --git a/runtime/themes/ayu_light.toml b/runtime/themes/ayu_light.toml index d4cb56de8a5b..6c405381d044 100644 --- a/runtime/themes/ayu_light.toml +++ b/runtime/themes/ayu_light.toml @@ -36,11 +36,15 @@ # Interface "ui.background"= { bg = "background" } -"ui.cursor" = { fg = "dark_gray", bg = "orange" } +"ui.cursor" = { fg = "dark_gray", bg = "yellow" } +"ui.cursor.primary" = { fg = "dark_gray", bg = "orange" } "ui.cursor.match" = "orange" "ui.linenr" = "dark_gray" "ui.linenr.selected" = "gray" "ui.statusline" = { fg = "foreground", bg = "black" } +"ui.statusline.normal" = { fg = "black", bg = "blue" } +"ui.statusline.insert" = { fg = "black", bg = "orange" } +"ui.statusline.select" = { fg = "black", bg = "magenta" } "ui.cursorline" = { bg = "black" } "ui.popup" = { fg = "#7B91b3", bg = "black" } "ui.window" = "dark_gray" diff --git a/runtime/themes/ayu_mirage.toml b/runtime/themes/ayu_mirage.toml index b27efc1cccb1..a4b74fcfbd77 100644 --- a/runtime/themes/ayu_mirage.toml +++ b/runtime/themes/ayu_mirage.toml @@ -36,11 +36,15 @@ # Interface "ui.background"= { bg = "background" } -"ui.cursor" = { fg = "dark_gray", bg = "orange" } +"ui.cursor" = { fg = "dark_gray", bg = "yellow" } +"ui.cursor.primary" = { fg = "dark_gray", bg = "orange" } "ui.cursor.match" = "orange" "ui.linenr" = "dark_gray" "ui.linenr.selected" = "gray" "ui.statusline" = { fg = "foreground", bg = "black" } +"ui.statusline.normal" = { fg = "black", bg = "blue" } +"ui.statusline.insert" = { fg = "black", bg = "orange" } +"ui.statusline.select" = { fg = "black", bg = "magenta" } "ui.cursorline" = { bg = "black" } "ui.popup" = { fg = "#7B91b3", bg = "black" } "ui.window" = "dark_gray" From ee7413a3fd723015843e569924abbfbf32b56182 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 20 Apr 2023 22:53:27 -0500 Subject: [PATCH 42/44] tui: Allow toggling mouse capture at runtime (#6675) This picks up changes to the `editor.mouse` option at runtime - either through `:set-option` or `:config-reload`. When the value changes, we tell the terminal to enable or disable mouse capture sequences. --- helix-term/src/application.rs | 5 +++++ helix-tui/src/backend/crossterm.rs | 16 ++++++++++++++++ helix-tui/src/backend/mod.rs | 1 + helix-tui/src/backend/test.rs | 4 ++++ helix-tui/src/terminal.rs | 4 ++++ 5 files changed, 30 insertions(+) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index cda498e2fbbe..b54d6835a5af 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -361,6 +361,9 @@ impl Application { ConfigEvent::Update(editor_config) => { let mut app_config = (*self.config.load().clone()).clone(); app_config.editor = *editor_config; + if let Err(err) = self.terminal.reconfigure(app_config.editor.clone().into()) { + self.editor.set_error(err.to_string()); + }; self.config.store(Arc::new(app_config)); } } @@ -419,6 +422,8 @@ impl Application { .map_err(|err| anyhow::anyhow!("Failed to load config: {}", err))?; self.refresh_language_config()?; self.refresh_theme(&default_config)?; + self.terminal + .reconfigure(default_config.editor.clone().into())?; // Store new config self.config.store(Arc::new(default_config)); Ok(()) diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs index 9d70a9fb0ab2..0c32028ece7c 100644 --- a/helix-tui/src/backend/crossterm.rs +++ b/helix-tui/src/backend/crossterm.rs @@ -63,6 +63,7 @@ pub struct CrosstermBackend { buffer: W, capabilities: Capabilities, supports_keyboard_enhancement_protocol: OnceCell, + mouse_capture_enabled: bool, } impl CrosstermBackend @@ -74,6 +75,7 @@ where buffer, capabilities: Capabilities::from_env_or_default(config), supports_keyboard_enhancement_protocol: OnceCell::new(), + mouse_capture_enabled: false, } } @@ -123,6 +125,7 @@ where execute!(self.buffer, terminal::Clear(terminal::ClearType::All))?; if config.enable_mouse_capture { execute!(self.buffer, EnableMouseCapture)?; + self.mouse_capture_enabled = true; } if self.supports_keyboard_enhancement_protocol() { execute!( @@ -136,6 +139,19 @@ where Ok(()) } + fn reconfigure(&mut self, config: Config) -> io::Result<()> { + if self.mouse_capture_enabled != config.enable_mouse_capture { + if config.enable_mouse_capture { + execute!(self.buffer, EnableMouseCapture)?; + } else { + execute!(self.buffer, DisableMouseCapture)?; + } + self.mouse_capture_enabled = config.enable_mouse_capture; + } + + Ok(()) + } + fn restore(&mut self, config: Config) -> io::Result<()> { // reset cursor shape write!(self.buffer, "\x1B[0 q")?; diff --git a/helix-tui/src/backend/mod.rs b/helix-tui/src/backend/mod.rs index 6d7c3894258b..6994bc6f5806 100644 --- a/helix-tui/src/backend/mod.rs +++ b/helix-tui/src/backend/mod.rs @@ -14,6 +14,7 @@ pub use self::test::TestBackend; pub trait Backend { fn claim(&mut self, config: Config) -> Result<(), io::Error>; + fn reconfigure(&mut self, config: Config) -> Result<(), io::Error>; fn restore(&mut self, config: Config) -> Result<(), io::Error>; fn force_restore() -> Result<(), io::Error>; fn draw<'a, I>(&mut self, content: I) -> Result<(), io::Error> diff --git a/helix-tui/src/backend/test.rs b/helix-tui/src/backend/test.rs index ff133ff3e846..771cc30945ec 100644 --- a/helix-tui/src/backend/test.rs +++ b/helix-tui/src/backend/test.rs @@ -111,6 +111,10 @@ impl Backend for TestBackend { Ok(()) } + fn reconfigure(&mut self, _config: Config) -> Result<(), io::Error> { + Ok(()) + } + fn restore(&mut self, _config: Config) -> Result<(), io::Error> { Ok(()) } diff --git a/helix-tui/src/terminal.rs b/helix-tui/src/terminal.rs index 802a8c1d9f53..8b7342751168 100644 --- a/helix-tui/src/terminal.rs +++ b/helix-tui/src/terminal.rs @@ -116,6 +116,10 @@ where self.backend.claim(config) } + pub fn reconfigure(&mut self, config: Config) -> io::Result<()> { + self.backend.reconfigure(config) + } + pub fn restore(&mut self, config: Config) -> io::Result<()> { self.backend.restore(config) } From a1044a6c68bc822021da204f81e1d7c0ba13df31 Mon Sep 17 00:00:00 2001 From: "Michael T. Mordowanec" Date: Fri, 21 Apr 2023 23:45:50 +0200 Subject: [PATCH 43/44] Change soft-wrap.wrap_at_text_width to kebab case in documentation (#6842) Solves #6803. --- book/src/configuration.md | 2 +- book/src/languages.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/book/src/configuration.md b/book/src/configuration.md index 38f9f9eb2383..1fdbf00520fa 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -60,7 +60,7 @@ Its settings will be merged with the configuration directory `config.toml` and t | `rulers` | List of column positions at which to display the rulers. Can be overridden by language specific `rulers` in `languages.toml` file | `[]` | | `bufferline` | Renders a line at the top of the editor displaying open buffers. Can be `always`, `never` or `multiple` (only shown if more than one buffer is in use) | `never` | | `color-modes` | Whether to color the mode indicator with different colors depending on the mode itself | `false` | -| `text-width` | Maximum line length. Used for the `:reflow` command and soft-wrapping if `soft-wrap.wrap_at_text_width` is set | `80` | +| `text-width` | Maximum line length. Used for the `:reflow` command and soft-wrapping if `soft-wrap.wrap-at-text-width` is set | `80` | | `workspace-lsp-roots` | Directories relative to the workspace root that are treated as LSP roots. Should only be set in `.helix/config.toml` | `[]` | ### `[editor.statusline]` Section diff --git a/book/src/languages.md b/book/src/languages.md index f44509fc84f5..fe4db141309d 100644 --- a/book/src/languages.md +++ b/book/src/languages.md @@ -63,7 +63,7 @@ These configuration keys are available: | `config` | Language Server configuration | | `grammar` | The tree-sitter grammar to use (defaults to the value of `name`) | | `formatter` | The formatter for the language, it will take precedence over the lsp when defined. The formatter must be able to take the original file as input from stdin and write the formatted file to stdout | -| `text-width` | Maximum line length. Used for the `:reflow` command and soft-wrapping if `soft-wrap.wrap_at_text_width` is set, defaults to `editor.text-width` | +| `text-width` | Maximum line length. Used for the `:reflow` command and soft-wrapping if `soft-wrap.wrap-at-text-width` is set, defaults to `editor.text-width` | | `workspace-lsp-roots` | Directories relative to the workspace root that are treated as LSP roots. Should only be set in `.helix/config.toml`. Overwrites the setting of the same name in `config.toml` if set. | ### File-type detection and the `file-types` key From b7c62e200e0fbe600855e6a2d492286349cae4ae Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Sat, 22 Apr 2023 12:38:25 +0200 Subject: [PATCH 44/44] fix windows builds (#6845) --- helix-loader/src/grammar.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index 3dac237c8c41..16955187e729 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -433,11 +433,12 @@ fn build_tree_sitter_library( for (key, value) in compiler.env() { command.env(key, value); } + command.args(compiler.args()); // used to delay dropping the temporary object file until after the compilation is complete let _path_guard; - if cfg!(all(windows, target_env = "msvc")) { + if compiler.is_like_msvc() { command .args(["/nologo", "/LD", "/I"]) .arg(header_path) @@ -455,20 +456,20 @@ fn build_tree_sitter_library( } cpp_command.args(compiler.args()); let object_file = - library_path.with_file_name(format!("{}_scanner.o", &grammar.grammar_id)); + library_path.with_file_name(format!("{}_scanner.obj", &grammar.grammar_id)); cpp_command .args(["/nologo", "/LD", "/I"]) .arg(header_path) .arg("/Od") .arg("/utf-8") .arg("/std:c++14") - .arg("/o") - .arg(&object_file) + .arg(format!("/Fo{}", object_file.display())) .arg("/c") .arg(scanner_path); let output = cpp_command .output() .context("Failed to execute C++ compiler")?; + if !output.status.success() { return Err(anyhow!( "Parser compilation failed.\nStdout: {}\nStderr: {}",