From d7136d691a32cb327c358ab9e19bd9d25d61a457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Thu, 10 Nov 2022 00:42:44 +0000 Subject: [PATCH 1/8] Update ayu themes (#4662) --- runtime/themes/ayu_dark.toml | 76 ++++++++++++------------ runtime/themes/ayu_light.toml | 103 +++++++++++++++------------------ runtime/themes/ayu_mirage.toml | 93 +++++++++++++++-------------- 3 files changed, 132 insertions(+), 140 deletions(-) diff --git a/runtime/themes/ayu_dark.toml b/runtime/themes/ayu_dark.toml index 43fffee8c4f52..3b989f828d1c0 100644 --- a/runtime/themes/ayu_dark.toml +++ b/runtime/themes/ayu_dark.toml @@ -2,56 +2,56 @@ # Based on the AYU theme colors from https://github.com/dempfi/ayu # Syntax highlighting -"type" = { fg = "blue" } -"type.builtin" = { fg = "blue" } -"constructor" = { fg = "green" } -"constant" = { fg = "magenta" } -"string" = { fg = "green" } -"string.regexp" = { fg = "orange" } -"string.special" = { fg = "yellow" } +"type" = "blue" +"type.builtin" = "blue" +"constructor" = "green" +"constant" = "magenta" +"string" = "green" +"string.regexp" = "orange" +"string.special" = "yellow" "comment" = { fg = "gray", modifiers = ["italic"] } -"variable" = { fg = "foreground" } -"variable.parameter" = { fg = "yellow" } -"label" = { fg = "orange" } -"punctuation" = { fg = "foreground" } -"keyword" = { fg = "orange" } -"keyword.control" = { fg = "yellow" } -"keyword.directive" = { fg = "yellow" } -"operator" = { fg = "orange" } -"function" = { fg = "yellow", modifiers = ["bold"] } -"tag" = { fg = "blue" } -"namespace" = { fg = "blue" } -"markup.heading" = { fg = "orange" } -"markup.list" = { fg = "yellow" } +"comment.block.documentation" = { fg = "blue", modifiers = ["italic"] } +"variable" = "foreground" +"label" = "orange" +"punctuation" = "foreground" +"keyword" = "orange" +"keyword.control" = "yellow" +"keyword.directive" = "yellow" +"operator" = "orange" +"function" = "yellow" +"tag" = "blue" +"namespace" = "blue" +"markup.heading" = "orange" +"markup.list" = "yellow" "markup.raw.block" = { bg = "gray", fg = "orange" } -"markup.link.url" = { fg = "blue" } -"markup.link.text" = { fg = "yellow" } -"markup.link.label" = { fg = "green" } -"markup.quote" = { fg = "yellow" } -"diff.plus" = { fg = "green" } -"diff.minus" = { fg = "red" } -"diff.delta" = { fg = "green" } +"markup.link.url" = "blue" +"markup.link.text" = "yellow" +"markup.link.label" = "green" +"markup.quote" = "yellow" +"diff.plus" = "green" +"diff.minus" = "red" +"diff.delta" = "yellow" # Interface "ui.background"= { bg = "background" } -"ui.cursor" = { bg = "yellow", fg = "dark_gray" } -"ui.cursor.match" = { fg = "orange" } -"ui.linenr" = { fg = "dark_gray" } -"ui.linenr.selected" = { fg = "orange" } +"ui.cursor" = { modifiers = ["reversed"] } +"ui.cursor.match" = "orange" +"ui.linenr" = "dark_gray" +"ui.linenr.selected" = "gray" "ui.statusline" = { fg = "foreground", bg = "black" } "ui.cursorline" = { bg = "black" } "ui.popup" = { fg = "#7B91b3", bg = "black" } -"ui.window" = { fg = "dark_gray" } +"ui.window" = "dark_gray" "ui.help" = { fg = "#7B91b3", bg = "black" } -"ui.text" = { fg = "foreground" } +"ui.text" = "foreground" "ui.text.focus" = { bg = "dark_gray", fg = "foreground" } -"ui.text.info" = { fg = "foreground" } -"ui.virtual.whitespace" = { fg = "dark_gray" } +"ui.text.info" = "foreground" +"ui.virtual.whitespace" = "dark_gray" "ui.virtual.ruler" = { bg = "black" } "ui.menu" = { fg = "foreground", bg = "black" } -"ui.menu.selected" = { bg = "orange", fg = "background" } +"ui.menu.selected" = { bg = "gray", fg = "background" } "ui.selection" = { bg = "dark_gray" } -"warning" = { fg = "yellow" } +"warning" = "yellow" "error" = { fg = "red", modifiers = ["bold"] } "info" = { fg = "blue", modifiers = ["bold"] } "hint" = { fg = "blue", modifiers = ["bold"] } @@ -62,7 +62,7 @@ "ui.bufferline" = { fg = "gray", bg = "background" } "ui.bufferline.active" = { fg = "foreground", bg = "dark_gray" } -"special" = { fg = "orange" } +"special" = "orange" [palette] background = "#0f1419" diff --git a/runtime/themes/ayu_light.toml b/runtime/themes/ayu_light.toml index 809436139264a..6a801951f8e30 100644 --- a/runtime/themes/ayu_light.toml +++ b/runtime/themes/ayu_light.toml @@ -2,55 +2,56 @@ # Based on the AYU theme colors from https://github.com/dempfi/ayu # Syntax highlighting -"type" = { fg = "blue" } -"type.builtin" = { fg = "blue" } -"constructor" = { fg = "green" } -"constant" = { fg = "magenta" } -"string" = { fg = "green" } -"string.regexp" = { fg = "orange" } -"string.special" = { fg = "yellow" } +"type" = "blue" +"type.builtin" = "blue" +"constructor" = "green" +"constant" = "magenta" +"string" = "green" +"string.regexp" = "orange" +"string.special" = "yellow" "comment" = { fg = "gray", modifiers = ["italic"] } -"variable" = { fg = "foreground" } -"variable.parameter" = { fg = "yellow" } -"label" = { fg = "orange" } -"punctuation" = { fg = "foreground" } -"keyword" = { fg = "orange" } -"keyword.control" = { fg = "yellow" } -"keyword.directive" = { fg = "yellow" } -"operator" = { fg = "orange" } -"function" = { fg = "yellow", modifiers = ["bold"] } -"tag" = { fg = "blue" } -"namespace" = { fg = "blue" } -"markup.heading" = { fg = "orange" } -"markup.list" = { fg = "yellow" } +"comment.block.documentation" = { fg = "blue", modifiers = ["italic"] } +"variable" = "foreground" +"label" = "orange" +"punctuation" = "foreground" +"keyword" = "orange" +"keyword.control" = "yellow" +"keyword.directive" = "yellow" +"operator" = "orange" +"function" = "yellow" +"tag" = "blue" +"namespace" = "blue" +"markup.heading" = "orange" +"markup.list" = "yellow" "markup.raw.block" = { bg = "gray", fg = "orange" } -"markup.link.url" = { fg = "blue" } -"markup.link.text" = { fg = "yellow" } -"markup.link.label" = { fg = "green" } -"markup.quote" = { fg = "yellow" } -"diff.plus" = { fg = "green" } -"diff.minus" = { fg = "red" } -"diff.delta" = { fg = "green" } +"markup.link.url" = "blue" +"markup.link.text" = "yellow" +"markup.link.label" = "green" +"markup.quote" = "yellow" +"diff.plus" = "green" +"diff.minus" = "red" +"diff.delta" = "yellow" # Interface "ui.background"= { bg = "background" } -"ui.cursor" = { bg = "yellow", fg = "light_gray" } -"ui.cursor.match" = { fg = "orange" } -"ui.linenr" = { fg = "light_gray" } -"ui.linenr.selected" = { fg = "orange" } +"ui.cursor" = { modifiers = ["reversed"] } +"ui.cursor.match" = "orange" +"ui.linenr" = "dark_gray" +"ui.linenr.selected" = "gray" +"ui.statusline" = { fg = "foreground", bg = "black" } "ui.cursorline" = { bg = "black" } -"ui.popup" = { bg = "black" } -"ui.window" = { fg = "light_gray" } -"ui.help" = { fg = "foreground", bg = "black" } -"ui.text" = { fg = "foreground" } -"ui.text.focus" = { bg = "light_gray", fg = "foreground" } -"ui.text.info" = { fg = "foreground" } -"ui.virtual.whitespace" = { fg = "light_gray" } +"ui.popup" = { fg = "#7B91b3", bg = "black" } +"ui.window" = "dark_gray" +"ui.help" = { fg = "#7B91b3", bg = "black" } +"ui.text" = "foreground" +"ui.text.focus" = { bg = "dark_gray", fg = "foreground" } +"ui.text.info" = "foreground" +"ui.virtual.whitespace" = "dark_gray" "ui.virtual.ruler" = { bg = "black" } "ui.menu" = { fg = "foreground", bg = "black" } -"ui.menu.selected" = { bg = "orange", fg = "background" } -"ui.selection" = { bg = "light_gray" } -"warning" = { fg = "yellow" } +"ui.menu.selected" = { bg = "gray", fg = "background" } +"ui.selection" = { bg = "dark_gray" } +"warning" = "yellow" "error" = { fg = "red", modifiers = ["bold"] } "info" = { fg = "blue", modifiers = ["bold"] } "hint" = { fg = "blue", modifiers = ["bold"] } @@ -58,30 +59,22 @@ "diagnostic.info"= { fg = "blue", modifiers = ["underlined"] } "diagnostic.warning"= { fg = "yellow", modifiers = ["underlined"] } "diagnostic.error"= { fg = "red", modifiers = ["underlined"] } -"ui.bufferline" = { fg = "ui_foreground", bg = "ui_background" } -"ui.bufferline.active" = { fg = "ui_background", bg = "ui_foreground" } -"ui.statusline" = { fg = "ui_foreground", bg = "ui_background" } -"ui.statusline.inactive" = { fg = "ui_foreground", bg = "ui_background" } -"ui.statusline.normal" = { fg = "white", bg = "light_blue" } -"ui.statusline.insert" = { fg = "white", bg = "orange" } -"ui.statusline.select" = { fg = "white", bg = "magenta" } +"ui.bufferline" = { fg = "gray", bg = "background" } +"ui.bufferline.active" = { fg = "foreground", bg = "dark_gray" } -"special" = { fg = "orange" } +"special" = "orange" [palette] -background = "#fcfcfc" +background = "#fafafa" foreground = "#5c6166" -ui_foreground = "#8a9199" -ui_background = "#f8f9fa" - black = "#e7eaed" white = "#fcfcfc" blue = "#399ee6" light_blue = "#55b4d4" cyan = "#478acc" -light_gray = "#e7eaed" -gray = "#787b8099" +dark_gray = "#d8d8d7" +gray = "#828c9a" green = "#86b300" magenta = "#a37acc" orange = "#fa8d3e" diff --git a/runtime/themes/ayu_mirage.toml b/runtime/themes/ayu_mirage.toml index e01866a90fdfa..b1abd9a3c27d6 100644 --- a/runtime/themes/ayu_mirage.toml +++ b/runtime/themes/ayu_mirage.toml @@ -2,57 +2,56 @@ # Based on the AYU theme colors from https://github.com/dempfi/ayu # Syntax highlighting -"type" = { fg = "blue" } -"type.builtin" = { fg = "blue" } -"constructor" = { fg = "green" } -"constant" = { fg = "magenta" } -"string" = { fg = "green" } -"string.regexp" = { fg = "orange" } -"string.special" = { fg = "yellow" } +"type" = "blue" +"type.builtin" = "blue" +"constructor" = "green" +"constant" = "magenta" +"string" = "green" +"string.regexp" = "orange" +"string.special" = "yellow" "comment" = { fg = "gray", modifiers = ["italic"] } -"variable" = { fg = "foreground" } -"variable.parameter" = { fg = "yellow" } -"label" = { fg = "orange" } -"punctuation" = { fg = "foreground" } -"keyword" = { fg = "orange" } -"keyword.control" = { fg = "yellow" } -"keyword.directive" = { fg = "yellow" } -"operator" = { fg = "orange" } -"function" = { fg = "yellow", modifiers = ["bold"] } -"tag" = { fg = "blue" } -"namespace" = { fg = "blue" } -"markup.heading" = { fg = "orange" } -"markup.list" = { fg = "yellow" } +"comment.block.documentation" = { fg = "blue", modifiers = ["italic"] } +"variable" = "foreground" +"label" = "orange" +"punctuation" = "foreground" +"keyword" = "orange" +"keyword.control" = "yellow" +"keyword.directive" = "yellow" +"operator" = "orange" +"function" = "yellow" +"tag" = "blue" +"namespace" = "blue" +"markup.heading" = "orange" +"markup.list" = "yellow" "markup.raw.block" = { bg = "gray", fg = "orange" } -"markup.link.url" = { fg = "blue" } -"markup.link.text" = { fg = "yellow" } -"markup.link.label" = { fg = "green" } -"markup.quote" = { fg = "yellow" } -"diff.plus" = { fg = "green" } -"diff.minus" = { fg = "red" } -"diff.delta" = { fg = "green" } +"markup.link.url" = "blue" +"markup.link.text" = "yellow" +"markup.link.label" = "green" +"markup.quote" = "yellow" +"diff.plus" = "green" +"diff.minus" = "red" +"diff.delta" = "yellow" # Interface "ui.background"= { bg = "background" } -"ui.cursor" = { bg = "green", fg = "dark_gray" } -"ui.cursor.primary" = { bg = "orange", fg = "dark_gray" } -"ui.cursor.match" = { fg = "orange" } -"ui.linenr" = { fg = "dark_gray" } -"ui.linenr.selected" = { fg = "orange" } -"ui.cursorline" = { bg = "black" } +"ui.cursor" = { modifiers = ["reversed"] } +"ui.cursor.match" = "orange" +"ui.linenr" = "dark_gray" +"ui.linenr.selected" = "gray" "ui.statusline" = { fg = "foreground", bg = "black" } -"ui.popup" = { bg = "black" } -"ui.window" = { fg = "dark_gray" } -"ui.help" = { fg = "foreground", bg = "black" } -"ui.text" = { fg = "foreground" } +"ui.cursorline" = { bg = "black" } +"ui.popup" = { fg = "#7B91b3", bg = "black" } +"ui.window" = "dark_gray" +"ui.help" = { fg = "#7B91b3", bg = "black" } +"ui.text" = "foreground" "ui.text.focus" = { bg = "dark_gray", fg = "foreground" } -"ui.text.info" = { fg = "foreground" } -"ui.virtual.whitespace" = { fg = "dark_gray" } +"ui.text.info" = "foreground" +"ui.virtual.whitespace" = "dark_gray" "ui.virtual.ruler" = { bg = "black" } "ui.menu" = { fg = "foreground", bg = "black" } -"ui.menu.selected" = { bg = "orange", fg = "background" } +"ui.menu.selected" = { bg = "gray", fg = "background" } "ui.selection" = { bg = "dark_gray" } -"warning" = { fg = "yellow" } +"warning" = "yellow" "error" = { fg = "red", modifiers = ["bold"] } "info" = { fg = "blue", modifiers = ["bold"] } "hint" = { fg = "blue", modifiers = ["bold"] } @@ -60,19 +59,19 @@ "diagnostic.info"= { fg = "blue", modifiers = ["underlined"] } "diagnostic.warning"= { fg = "yellow", modifiers = ["underlined"] } "diagnostic.error"= { fg = "red", modifiers = ["underlined"] } -"ui.bufferline" = { fg = "gray", bg = "black" } -"ui.bufferline.active" = { fg = "foreground", bg = "background" } +"ui.bufferline" = { fg = "gray", bg = "background" } +"ui.bufferline.active" = { fg = "foreground", bg = "dark_gray" } -"special" = { fg = "orange" } +"special" = "orange" [palette] -background = "#242936" +background = "#1f2430" foreground = "#cccac2" black = "#1a1f29" blue = "#73d0ff" -dark_gray = "#8a919959" -cyan = "#80bfff" +dark_gray = "#323843" +cyan = "#444b55" gray = "#565b66" green = "#d5ff80" magenta = "#dfbfff" From 183d1fadf463093b7e11ed60dc169d512d7ae290 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Thu, 10 Nov 2022 16:17:01 +0100 Subject: [PATCH 2/8] feat: add sc to filetypes for Scala (#4697) Files ending in `.sc` are known as "Scala Scripts". The scalac compiler knows how to handle these, popular tools like [Ammonite](https://github.com/com-lihaoyi/Ammonite) and [scala-cli](https://github.com/Virtuslab/scala-cli) use them, and even some Scala build tools like [mill](https://github.com/com-lihaoyi/mill) use them as their build files (`build.sc`). This change just makes sure that they are treated as Scala files so Metals kicks in. --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 41558e10e9ad5..4ac39b02a0a05 100644 --- a/languages.toml +++ b/languages.toml @@ -998,7 +998,7 @@ source = { git = "https://github.com/UserNobody14/tree-sitter-dart", rev = "2d7f name = "scala" scope = "source.scala" roots = ["build.sbt", "pom.xml"] -file-types = ["scala", "sbt"] +file-types = ["scala", "sbt", "sc"] comment-token = "//" indent = { tab-width = 2, unit = " " } language-server = { command = "metals" } From bc52b0369b35f670e29728de5e3c0afdf804f9d8 Mon Sep 17 00:00:00 2001 From: janos-r <30606201+janos-r@users.noreply.github.com> Date: Thu, 10 Nov 2022 16:18:38 +0100 Subject: [PATCH 3/8] theme dark_plus color-modes insert and select (#4678) --- runtime/themes/dark_plus.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/themes/dark_plus.toml b/runtime/themes/dark_plus.toml index 305117c67f2f2..b4e3079865196 100644 --- a/runtime/themes/dark_plus.toml +++ b/runtime/themes/dark_plus.toml @@ -75,6 +75,8 @@ "ui.cursorline.primary" = { bg = "dark_gray3" } "ui.statusline" = { fg = "white", bg = "blue" } "ui.statusline.inactive" = { fg = "white", bg = "blue" } +"ui.statusline.insert" = { fg = "white", bg = "yellow" } +"ui.statusline.select" = { fg = "white", bg = "magenta" } "ui.bufferline" = { fg = "text", bg = "widget" } "ui.bufferline.active" = { fg = "white", bg = "blue" } From e17ad2722a12ffd6ea3a42405ce6ab0ccb8c0486 Mon Sep 17 00:00:00 2001 From: Philip Giuliani Date: Thu, 10 Nov 2022 16:21:31 +0100 Subject: [PATCH 4/8] Enable elixir-ls for heex language (#4679) --- book/src/generated/lang-support.md | 2 +- languages.toml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 411e67b8a974e..086cd3c68f430 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -50,7 +50,7 @@ | hare | ✓ | | | | | haskell | ✓ | | | `haskell-language-server-wrapper` | | hcl | ✓ | | ✓ | `terraform-ls` | -| heex | ✓ | ✓ | | | +| heex | ✓ | ✓ | | `elixir-ls` | | html | ✓ | | | `vscode-html-language-server` | | idris | | | | `idris2-lsp` | | iex | ✓ | | | | diff --git a/languages.toml b/languages.toml index 4ac39b02a0a05..8b87cd1d33383 100644 --- a/languages.toml +++ b/languages.toml @@ -1355,6 +1355,8 @@ injection-regex = "heex" file-types = ["heex"] roots = ["mix.exs", "mix.lock"] indent = { tab-width = 2, unit = " " } +language-server = { command = "elixir-ls" } +config = { elixirLS.dialyzerEnabled = false } [[grammar]] name = "heex" From bb5a122cdef79978f7ec770f30da914eee5bb9f3 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Fri, 11 Nov 2022 02:47:12 +0100 Subject: [PATCH 5/8] improve performance of tree sitter query captures (for text object motions in particular) (#4707) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add tree sitter match limit to avoid slowdowns for larger files Affects all tree sitter queries and should speedup both syntax highlighting and text object queries. This has been shown to fix significant slowdowns with textobjects for rust files as small as 3k loc. * Apply suggestions from code review Co-authored-by: Blaž Hrastnik Co-authored-by: Blaž Hrastnik --- helix-core/src/syntax.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 0f62577f869c3..b320fcdabaa43 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -354,6 +354,25 @@ impl<'a> CapturedNode<'a> { } } +/// The number of matches a TS cursor can at once to avoid performance problems for medium to large files. +/// Set with `set_match_limit`. +/// Using such a limit means that we lose valid captures in, so there is fundamentally a tradeoff here. +/// +/// +/// Old tree sitter versions used a limit of 32 by default until this limit was removed in version `0.19.5` (must now be set manually). +/// However, this causes performance issues for medium to large files. +/// In helix, this problem caused treesitter motions to take multiple seconds to complete in medium-sized rust files (3k loc). +/// Neovim also encountered this problem and reintroduced this limit after it was removed upstream +/// (see and ). +/// The number used here is fundamentally a tradeoff between breaking some obscure edge cases and performance. +/// +/// +/// A value of 64 was chosen because neovim uses that value. +/// Neovim chose this value somewhat arbitrarily () adjusting it whenever issues occur in practice. +/// However this value has been in use for a long time and due to the large userbase of neovim it is probably a good choice. +/// If this limit causes problems for a grammar in the future, it could be increased. +const TREE_SITTER_MATCH_LIMIT: u32 = 64; + impl TextObjectQuery { /// Run the query on the given node and return sub nodes which match given /// capture ("function.inside", "class.around", etc). @@ -394,6 +413,8 @@ impl TextObjectQuery { .iter() .find_map(|cap| self.query.capture_index_for_name(cap))?; + cursor.set_match_limit(TREE_SITTER_MATCH_LIMIT); + let nodes = cursor .captures(&self.query, node, RopeProvider(slice)) .filter_map(move |(mat, _)| { @@ -843,6 +864,7 @@ impl Syntax { let mut cursor = ts_parser.cursors.pop().unwrap_or_else(QueryCursor::new); // TODO: might need to set cursor range cursor.set_byte_range(0..usize::MAX); + cursor.set_match_limit(TREE_SITTER_MATCH_LIMIT); let source_slice = source.slice(..); @@ -1032,6 +1054,7 @@ impl Syntax { // if reusing cursors & no range this resets to whole range cursor_ref.set_byte_range(range.clone().unwrap_or(0..usize::MAX)); + cursor_ref.set_match_limit(TREE_SITTER_MATCH_LIMIT); let mut captures = cursor_ref .captures( From 7367abd6c6f764b45802613ca9c46e921b4394e6 Mon Sep 17 00:00:00 2001 From: Gabriel Dinner-David <82682503+gabydd@users.noreply.github.com> Date: Fri, 11 Nov 2022 00:42:56 -0500 Subject: [PATCH 6/8] Update typescript grammar and queries (#4703) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(grammars): update treesitter grammar and queries * add override keyword * Update runtime/queries/typescript/highlights.scm Co-authored-by: Blaž Hrastnik --- languages.toml | 4 ++-- runtime/queries/typescript/highlights.scm | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 8b87cd1d33383..00eff068e51de 100644 --- a/languages.toml +++ b/languages.toml @@ -399,7 +399,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "typescript" -source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a", subpath = "typescript" } +source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "6aac031ad88dd6317f02ac0bb27d099a553a7d8c", subpath = "typescript" } [[language]] name = "tsx" @@ -413,7 +413,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "tsx" -source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a", subpath = "tsx" } +source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "6aac031ad88dd6317f02ac0bb27d099a553a7d8c", subpath = "tsx" } [[language]] name = "css" diff --git a/runtime/queries/typescript/highlights.scm b/runtime/queries/typescript/highlights.scm index 7c15cf3d433d8..fc8d110d12ec2 100644 --- a/runtime/queries/typescript/highlights.scm +++ b/runtime/queries/typescript/highlights.scm @@ -34,6 +34,7 @@ "implements" "keyof" "namespace" + "override" ] @keyword [ @@ -62,3 +63,15 @@ ((identifier) @type (#match? @type "^[A-Z]")) + +; Literals + +[ + (template_literal_type) +] @string + +; Tokens + +(template_type + "${" @punctuation.special + "}" @punctuation.special) @embedded From d7be5463c59a0983d6b507f2a35f6755a44d5c75 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Fri, 11 Nov 2022 14:49:56 +0100 Subject: [PATCH 7/8] update scala roots (#4701) This adds in a couple more roots that are common in Scala. - `build.sc` which is used in Mill - `build.gradle` for Scala Gradle projects - `.scala-build` for scala-cli projects --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 00eff068e51de..4013adb668c46 100644 --- a/languages.toml +++ b/languages.toml @@ -997,7 +997,7 @@ source = { git = "https://github.com/UserNobody14/tree-sitter-dart", rev = "2d7f [[language]] name = "scala" scope = "source.scala" -roots = ["build.sbt", "pom.xml"] +roots = ["build.sbt", "build.sc", "build.gradle", "pom.xml", ".scala-build"] file-types = ["scala", "sbt", "sc"] comment-token = "//" indent = { tab-width = 2, unit = " " } From 87e0db50488198972867870c30e844ddaff42dc1 Mon Sep 17 00:00:00 2001 From: wes adams Date: Wed, 9 Nov 2022 13:11:35 -0500 Subject: [PATCH 8/8] Statusline element that shows number of chars in primary selection Feature request: #4624 --- book/src/configuration.md | 1 + helix-term/src/ui/statusline.rs | 15 +++++++++++++++ helix-view/src/editor.rs | 3 +++ 3 files changed, 19 insertions(+) diff --git a/book/src/configuration.md b/book/src/configuration.md index 20abeba5a2163..8713c3ffe85dd 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -103,6 +103,7 @@ The following statusline elements can be configured: | `file-type` | The type of the opened file | | `diagnostics` | The number of warnings and/or errors | | `selections` | The number of active selections | +| `primary-selection-length` | The number of characters currently in primary selection | | `position` | The cursor position | | `position-percentage` | The cursor position as a percentage of the total number of lines | | `separator` | The string defined in `editor.statusline.separator` (defaults to `"│"`) | diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index b0e8ec5d2546e..2393cfd7e3bbb 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -142,6 +142,9 @@ where helix_view::editor::StatusLineElement::FileType => render_file_type, helix_view::editor::StatusLineElement::Diagnostics => render_diagnostics, helix_view::editor::StatusLineElement::Selections => render_selections, + helix_view::editor::StatusLineElement::PrimarySelectionLength => { + render_primary_selection_length + } helix_view::editor::StatusLineElement::Position => render_position, helix_view::editor::StatusLineElement::PositionPercentage => render_position_percentage, helix_view::editor::StatusLineElement::TotalLineNumbers => render_total_line_numbers, @@ -254,6 +257,18 @@ where ); } +fn render_primary_selection_length(context: &mut RenderContext, write: F) +where + F: Fn(&mut RenderContext, String, Option