From 9772a74040b123e2e503057b29fd636bff10bf95 Mon Sep 17 00:00:00 2001 From: chbk Date: Fri, 21 Feb 2025 13:33:10 +0100 Subject: [PATCH 1/6] Improve Markdown syntax highlighting --- .../src/markdown-inline/highlights.scm | 26 ++++++++++++++----- crates/languages/src/markdown/highlights.scm | 24 ++++++++++++++--- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/crates/languages/src/markdown-inline/highlights.scm b/crates/languages/src/markdown-inline/highlights.scm index 61c3e34c62973c..9951676ce0434f 100644 --- a/crates/languages/src/markdown-inline/highlights.scm +++ b/crates/languages/src/markdown-inline/highlights.scm @@ -1,6 +1,20 @@ -(emphasis) @emphasis -(strong_emphasis) @emphasis.strong -(code_span) @text.literal -(link_text) @link_text -(link_label) @link_text -(link_destination) @link_uri +(emphasis) @markup.emphasis +(strong_emphasis) @markup.emphasis.strong +(code_span) @markup.raw +(strikethrough) @markup.strikethrough + +[ + (inline_link) + (shortcut_link) + (collapsed_reference_link) + (full_reference_link) + (image) +] @markup.link + +(inline_link ["(" ")"] @markup.link.url) +(image ["(" ")"] @markup.link.url) +[ + (link_destination) + (uri_autolink) + (email_autolink) +] @markup.link.url diff --git a/crates/languages/src/markdown/highlights.scm b/crates/languages/src/markdown/highlights.scm index 6b9fa3482298c9..fdfee1b01643ab 100644 --- a/crates/languages/src/markdown/highlights.scm +++ b/crates/languages/src/markdown/highlights.scm @@ -1,7 +1,15 @@ +[ + (paragraph) + (indented_code_block) + (pipe_table) +] @text + [ (atx_heading) (setext_heading) -] @title + (thematic_break) +] @markup.heading +(setext_heading (paragraph) @markup.heading) [ (list_marker_plus) @@ -9,8 +17,18 @@ (list_marker_star) (list_marker_dot) (list_marker_parenthesis) -] @punctuation.list_marker + (block_quote_marker) +] @punctuation.markup + +(pipe_table_header "|" @punctuation.markup) +(pipe_table_row "|" @punctuation.markup) +(pipe_table_delimiter_row "|" @punctuation.markup) +(pipe_table_delimiter_cell "-" @punctuation.markup) (fenced_code_block (info_string - (language) @text.literal)) + (language) @punctuation.markup.embedded)) +(fenced_code_block_delimiter) @punctuation.markup.embedded + +(link_reference_definition) @markup.link +(link_destination) @markup.link.url From aac56fd5006bfcd33798be1e80afa00aa84adfca Mon Sep 17 00:00:00 2001 From: chbk Date: Fri, 21 Feb 2025 19:44:49 +0100 Subject: [PATCH 2/6] Reorder scopes --- crates/languages/src/gitcommit/highlights.scm | 2 +- crates/languages/src/markdown-inline/highlights.scm | 10 +++++----- crates/languages/src/markdown/highlights.scm | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/languages/src/gitcommit/highlights.scm b/crates/languages/src/gitcommit/highlights.scm index 319d76569e56f1..2c618edf9e1dc9 100644 --- a/crates/languages/src/gitcommit/highlights.scm +++ b/crates/languages/src/gitcommit/highlights.scm @@ -1,4 +1,4 @@ -(subject) @markup.heading +(subject) @heading.markup (path) @string.special.path (branch) @string.special.symbol (commit) @constant diff --git a/crates/languages/src/markdown-inline/highlights.scm b/crates/languages/src/markdown-inline/highlights.scm index 9951676ce0434f..82f91947ba8930 100644 --- a/crates/languages/src/markdown-inline/highlights.scm +++ b/crates/languages/src/markdown-inline/highlights.scm @@ -1,7 +1,7 @@ -(emphasis) @markup.emphasis -(strong_emphasis) @markup.emphasis.strong -(code_span) @markup.raw -(strikethrough) @markup.strikethrough +(emphasis) @emphasis.markup +(strong_emphasis) @emphasis.strong.markup +(code_span) @raw.markup +(strikethrough) @strikethrough.markup [ (inline_link) @@ -9,7 +9,7 @@ (collapsed_reference_link) (full_reference_link) (image) -] @markup.link +] @link.markup (inline_link ["(" ")"] @markup.link.url) (image ["(" ")"] @markup.link.url) diff --git a/crates/languages/src/markdown/highlights.scm b/crates/languages/src/markdown/highlights.scm index fdfee1b01643ab..24062713005eaa 100644 --- a/crates/languages/src/markdown/highlights.scm +++ b/crates/languages/src/markdown/highlights.scm @@ -8,8 +8,8 @@ (atx_heading) (setext_heading) (thematic_break) -] @markup.heading -(setext_heading (paragraph) @markup.heading) +] @heading.markup +(setext_heading (paragraph) @heading.markup) [ (list_marker_plus) @@ -27,8 +27,8 @@ (fenced_code_block (info_string - (language) @punctuation.markup.embedded)) -(fenced_code_block_delimiter) @punctuation.markup.embedded + (language) @punctuation.embedded.markup)) +(fenced_code_block_delimiter) @punctuation.embedded.markup -(link_reference_definition) @markup.link +(link_reference_definition) @link.markup (link_destination) @markup.link.url From 2f911cd7254143bbb987a37bf7bea893672a85c8 Mon Sep 17 00:00:00 2001 From: chbk Date: Fri, 21 Feb 2025 19:45:37 +0100 Subject: [PATCH 3/6] Rename to `@link.uri` --- crates/languages/src/gitcommit/highlights.scm | 2 +- crates/languages/src/markdown-inline/highlights.scm | 6 +++--- crates/languages/src/markdown/highlights.scm | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/languages/src/gitcommit/highlights.scm b/crates/languages/src/gitcommit/highlights.scm index 2c618edf9e1dc9..91cf8a9279e00e 100644 --- a/crates/languages/src/gitcommit/highlights.scm +++ b/crates/languages/src/gitcommit/highlights.scm @@ -2,7 +2,7 @@ (path) @string.special.path (branch) @string.special.symbol (commit) @constant -(item) @markup.link.url +(item) @link.uri.markup (header) @tag (change kind: "new file" @diff.plus) diff --git a/crates/languages/src/markdown-inline/highlights.scm b/crates/languages/src/markdown-inline/highlights.scm index 82f91947ba8930..88efefb81b3d1e 100644 --- a/crates/languages/src/markdown-inline/highlights.scm +++ b/crates/languages/src/markdown-inline/highlights.scm @@ -11,10 +11,10 @@ (image) ] @link.markup -(inline_link ["(" ")"] @markup.link.url) -(image ["(" ")"] @markup.link.url) +(inline_link ["(" ")"] @link.uri.markup) +(image ["(" ")"] @link.uri.markup) [ (link_destination) (uri_autolink) (email_autolink) -] @markup.link.url +] @link.uri.markup diff --git a/crates/languages/src/markdown/highlights.scm b/crates/languages/src/markdown/highlights.scm index 24062713005eaa..3fcf97570e3dcc 100644 --- a/crates/languages/src/markdown/highlights.scm +++ b/crates/languages/src/markdown/highlights.scm @@ -31,4 +31,4 @@ (fenced_code_block_delimiter) @punctuation.embedded.markup (link_reference_definition) @link.markup -(link_destination) @markup.link.url +(link_destination) @link.uri.markup From 4d122b8d5047e16ff0a3a547c71197fae0009bc4 Mon Sep 17 00:00:00 2001 From: chbk Date: Fri, 21 Feb 2025 19:59:48 +0100 Subject: [PATCH 4/6] Add syntax scopes to themes --- assets/themes/ayu/ayu.json | 78 +++++++++----- assets/themes/gruvbox/gruvbox.json | 168 +++++++++++++++++++---------- assets/themes/one/one.json | 52 ++++++--- 3 files changed, 204 insertions(+), 94 deletions(-) diff --git a/assets/themes/ayu/ayu.json b/assets/themes/ayu/ayu.json index 745eb2b4c27332..84501492855aa4 100644 --- a/assets/themes/ayu/ayu.json +++ b/assets/themes/ayu/ayu.json @@ -236,6 +236,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#bfbdb6ff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#628b80ff", "font_style": null, @@ -251,12 +256,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#fe8f40ff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#aad84cff", "font_style": null, "font_weight": null @@ -306,7 +311,7 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { + "punctuation.markup": { "color": "#a6a5a0ff", "font_style": null, "font_weight": null @@ -316,6 +321,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#fe8f40ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#5ac1feff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#a9d94bff", "font_style": null, @@ -346,11 +361,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#fe8f40ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#bfbdb6ff", "font_style": null, @@ -607,6 +617,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#5c6166ff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#8ca7c2ff", "font_style": null, @@ -622,12 +637,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#f98d3fff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#85b304ff", "font_style": null, "font_weight": null @@ -677,7 +692,7 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { + "punctuation.markup": { "color": "#73777bff", "font_style": null, "font_weight": null @@ -687,6 +702,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#f98d3fff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#3b9ee5ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#86b300ff", "font_style": null, @@ -717,11 +742,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#f98d3fff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#5c6166ff", "font_style": null, @@ -978,6 +998,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#cccac2ff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#7399a3ff", "font_style": null, @@ -993,12 +1018,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#fead66ff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#d5fe80ff", "font_style": null, "font_weight": null @@ -1048,7 +1073,7 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { + "punctuation.markup": { "color": "#b4b3aeff", "font_style": null, "font_weight": null @@ -1058,6 +1083,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#fead66ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#72cffeff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#d4fe7fff", "font_style": null, @@ -1088,11 +1123,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#fead66ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#cccac2ff", "font_style": null, diff --git a/assets/themes/gruvbox/gruvbox.json b/assets/themes/gruvbox/gruvbox.json index 958cf4797dc6f4..5e8f2891d5ce79 100644 --- a/assets/themes/gruvbox/gruvbox.json +++ b/assets/themes/gruvbox/gruvbox.json @@ -253,6 +253,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#b8bb25ff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#8c957dff", "font_style": null, @@ -268,12 +273,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#8ec07cff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#d3869bff", "font_style": null, "font_weight": null @@ -323,8 +328,8 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { - "color": "#ebdbb2ff", + "punctuation.markup": { + "color": "#83a598ff", "font_style": null, "font_weight": null }, @@ -333,6 +338,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#b8bb25ff", "font_style": null, @@ -363,11 +378,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#83a598ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#b8bb25ff", "font_style": null, @@ -641,6 +651,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#b8bb25ff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#8c957dff", "font_style": null, @@ -656,12 +671,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#8ec07cff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#d3869bff", "font_style": null, "font_weight": null @@ -711,8 +726,8 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { - "color": "#ebdbb2ff", + "punctuation.markup": { + "color": "#83a598ff", "font_style": null, "font_weight": null }, @@ -721,6 +736,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#b8bb25ff", "font_style": null, @@ -751,11 +776,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#83a598ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#b8bb25ff", "font_style": null, @@ -1029,6 +1049,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#b8bb25ff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#8c957dff", "font_style": null, @@ -1044,12 +1069,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#8ec07cff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#d3869bff", "font_style": null, "font_weight": null @@ -1099,8 +1124,8 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { - "color": "#ebdbb2ff", + "punctuation.markup": { + "color": "#83a598ff", "font_style": null, "font_weight": null }, @@ -1109,6 +1134,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#b8bb25ff", "font_style": null, @@ -1139,11 +1174,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#83a598ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#b8bb25ff", "font_style": null, @@ -1417,6 +1447,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#79740eff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#677562ff", "font_style": null, @@ -1432,12 +1467,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#427b58ff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#8f3e71ff", "font_style": null, "font_weight": null @@ -1487,8 +1522,8 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { - "color": "#282828ff", + "punctuation.markup": { + "color": "#066578ff", "font_style": null, "font_weight": null }, @@ -1497,6 +1532,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#066578ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#0b6678ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#79740eff", "font_style": null, @@ -1527,11 +1572,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#066578ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#79740eff", "font_style": null, @@ -1805,6 +1845,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#79740eff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#677562ff", "font_style": null, @@ -1820,12 +1865,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#427b58ff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#8f3e71ff", "font_style": null, "font_weight": null @@ -1875,8 +1920,8 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { - "color": "#282828ff", + "punctuation.markup": { + "color": "#066578ff", "font_style": null, "font_weight": null }, @@ -1885,6 +1930,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#066578ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#0b6678ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#79740eff", "font_style": null, @@ -1915,11 +1970,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#066578ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#79740eff", "font_style": null, @@ -2193,6 +2243,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#79740eff", + "font_style": null, + "font_weight": 700 + }, "hint": { "color": "#677562ff", "font_style": null, @@ -2208,12 +2263,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#427b58ff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#8f3e71ff", "font_style": null, "font_weight": null @@ -2263,8 +2318,8 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { - "color": "#282828ff", + "punctuation.markup": { + "color": "#066578ff", "font_style": null, "font_weight": null }, @@ -2273,6 +2328,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#066578ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#0b6678ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#79740eff", "font_style": null, @@ -2303,11 +2368,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#066578ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#79740eff", "font_style": null, diff --git a/assets/themes/one/one.json b/assets/themes/one/one.json index 9d7a29cd957783..70ad3affbe8836 100644 --- a/assets/themes/one/one.json +++ b/assets/themes/one/one.json @@ -239,6 +239,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#d07277ff", + "font_style": null, + "font_weight": 400 + }, "hint": { "color": "#788ca6ff", "font_style": null, @@ -254,12 +259,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#73ade9ff", "font_style": "normal", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#6eb4bfff", "font_style": null, "font_weight": null @@ -309,7 +314,7 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { + "punctuation.markup": { "color": "#d07277ff", "font_style": null, "font_weight": null @@ -319,6 +324,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#a1c181ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#74ade8ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#a1c181ff", "font_style": null, @@ -349,11 +364,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#a1c181ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#d07277ff", "font_style": null, @@ -618,6 +628,11 @@ "font_style": null, "font_weight": null }, + "heading": { + "color": "#d3604fff", + "font_style": null, + "font_weight": 400 + }, "hint": { "color": "#7274a7ff", "font_style": null, @@ -633,12 +648,12 @@ "font_style": null, "font_weight": null }, - "link_text": { + "link": { "color": "#5b79e3ff", "font_style": "italic", "font_weight": null }, - "link_uri": { + "link.uri": { "color": "#3882b7ff", "font_style": null, "font_weight": null @@ -688,7 +703,7 @@ "font_style": null, "font_weight": null }, - "punctuation.list_marker": { + "punctuation.markup": { "color": "#d3604fff", "font_style": null, "font_weight": null @@ -698,6 +713,16 @@ "font_style": null, "font_weight": null }, + "raw": { + "color": "#649f57ff", + "font_style": null, + "font_weight": null + }, + "strikethrough": { + "color": "#5c78e2ff", + "font_style": null, + "font_weight": null + }, "string": { "color": "#649f57ff", "font_style": null, @@ -728,11 +753,6 @@ "font_style": null, "font_weight": null }, - "text.literal": { - "color": "#649f57ff", - "font_style": null, - "font_weight": null - }, "title": { "color": "#d3604fff", "font_style": null, From eee156777dcde554e38baf33adb5d8a900ebe7ce Mon Sep 17 00:00:00 2001 From: chbk Date: Sat, 22 Feb 2025 14:07:32 +0100 Subject: [PATCH 5/6] Restore original selectors --- assets/themes/ayu/ayu.json | 36 +++++++++- assets/themes/gruvbox/gruvbox.json | 72 +++++++++++++++++-- assets/themes/one/one.json | 24 ++++++- .../src/markdown-inline/highlights.scm | 11 +-- crates/languages/src/markdown/highlights.scm | 10 +-- 5 files changed, 133 insertions(+), 20 deletions(-) diff --git a/assets/themes/ayu/ayu.json b/assets/themes/ayu/ayu.json index 84501492855aa4..dd5bfa46c0e5ef 100644 --- a/assets/themes/ayu/ayu.json +++ b/assets/themes/ayu/ayu.json @@ -261,7 +261,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#fe8f40ff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#aad84cff", "font_style": null, "font_weight": null @@ -361,6 +366,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#fe8f40ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#bfbdb6ff", "font_style": null, @@ -642,7 +652,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#f98d3fff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#85b304ff", "font_style": null, "font_weight": null @@ -742,6 +757,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#f98d3fff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#5c6166ff", "font_style": null, @@ -1023,7 +1043,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#fead66ff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#d5fe80ff", "font_style": null, "font_weight": null @@ -1123,6 +1148,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#fead66ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#cccac2ff", "font_style": null, diff --git a/assets/themes/gruvbox/gruvbox.json b/assets/themes/gruvbox/gruvbox.json index 5e8f2891d5ce79..b02bd997085bed 100644 --- a/assets/themes/gruvbox/gruvbox.json +++ b/assets/themes/gruvbox/gruvbox.json @@ -278,7 +278,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#8ec07cff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#d3869bff", "font_style": null, "font_weight": null @@ -378,6 +383,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#b8bb25ff", "font_style": null, @@ -676,7 +686,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#8ec07cff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#d3869bff", "font_style": null, "font_weight": null @@ -776,6 +791,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#b8bb25ff", "font_style": null, @@ -1074,7 +1094,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#8ec07cff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#d3869bff", "font_style": null, "font_weight": null @@ -1174,6 +1199,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#83a598ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#b8bb25ff", "font_style": null, @@ -1472,7 +1502,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#427b58ff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#8f3e71ff", "font_style": null, "font_weight": null @@ -1572,6 +1607,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#066578ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#79740eff", "font_style": null, @@ -1870,7 +1910,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#427b58ff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#8f3e71ff", "font_style": null, "font_weight": null @@ -1970,6 +2015,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#066578ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#79740eff", "font_style": null, @@ -2268,7 +2318,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#427b58ff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#8f3e71ff", "font_style": null, "font_weight": null @@ -2368,6 +2423,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#066578ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#79740eff", "font_style": null, diff --git a/assets/themes/one/one.json b/assets/themes/one/one.json index 70ad3affbe8836..4d5a2f9b78781e 100644 --- a/assets/themes/one/one.json +++ b/assets/themes/one/one.json @@ -264,7 +264,12 @@ "font_style": "normal", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#73ade9ff", + "font_style": "normal", + "font_weight": null + }, + "link_uri": { "color": "#6eb4bfff", "font_style": null, "font_weight": null @@ -364,6 +369,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#a1c181ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#d07277ff", "font_style": null, @@ -653,7 +663,12 @@ "font_style": "italic", "font_weight": null }, - "link.uri": { + "link_text": { + "color": "#5b79e3ff", + "font_style": "italic", + "font_weight": null + }, + "link_uri": { "color": "#3882b7ff", "font_style": null, "font_weight": null @@ -753,6 +768,11 @@ "font_style": null, "font_weight": null }, + "text.literal": { + "color": "#649f57ff", + "font_style": null, + "font_weight": null + }, "title": { "color": "#d3604fff", "font_style": null, diff --git a/crates/languages/src/markdown-inline/highlights.scm b/crates/languages/src/markdown-inline/highlights.scm index 88efefb81b3d1e..6097c48dbae9be 100644 --- a/crates/languages/src/markdown-inline/highlights.scm +++ b/crates/languages/src/markdown-inline/highlights.scm @@ -1,6 +1,6 @@ (emphasis) @emphasis.markup (strong_emphasis) @emphasis.strong.markup -(code_span) @raw.markup +(code_span) @text.literal.markup (strikethrough) @strikethrough.markup [ @@ -11,10 +11,13 @@ (image) ] @link.markup -(inline_link ["(" ")"] @link.uri.markup) -(image ["(" ")"] @link.uri.markup) +(link_text) @link_text.markup +(link_label) @link_text.markup + +(inline_link ["(" ")"] @link_uri.markup) +(image ["(" ")"] @link_uri.markup) [ (link_destination) (uri_autolink) (email_autolink) -] @link.uri.markup +] @link_uri.markup diff --git a/crates/languages/src/markdown/highlights.scm b/crates/languages/src/markdown/highlights.scm index 3fcf97570e3dcc..5337fe8371c521 100644 --- a/crates/languages/src/markdown/highlights.scm +++ b/crates/languages/src/markdown/highlights.scm @@ -8,8 +8,8 @@ (atx_heading) (setext_heading) (thematic_break) -] @heading.markup -(setext_heading (paragraph) @heading.markup) +] @title.markup +(setext_heading (paragraph) @title.markup) [ (list_marker_plus) @@ -17,9 +17,9 @@ (list_marker_star) (list_marker_dot) (list_marker_parenthesis) - (block_quote_marker) -] @punctuation.markup +] @punctuation.list_marker.markup +(block_quote_marker) @punctuation.markup (pipe_table_header "|" @punctuation.markup) (pipe_table_row "|" @punctuation.markup) (pipe_table_delimiter_row "|" @punctuation.markup) @@ -31,4 +31,4 @@ (fenced_code_block_delimiter) @punctuation.embedded.markup (link_reference_definition) @link.markup -(link_destination) @link.uri.markup +(link_destination) @link_uri.markup From f34c28b2dbda85e0114c72b5ca025d3f0c6018b6 Mon Sep 17 00:00:00 2001 From: chbk Date: Sat, 22 Feb 2025 14:08:17 +0100 Subject: [PATCH 6/6] Comment future selectors --- crates/languages/src/markdown-inline/highlights.scm | 12 ++++++------ crates/languages/src/markdown/highlights.scm | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/languages/src/markdown-inline/highlights.scm b/crates/languages/src/markdown-inline/highlights.scm index 6097c48dbae9be..72fc6fc9914ce1 100644 --- a/crates/languages/src/markdown-inline/highlights.scm +++ b/crates/languages/src/markdown-inline/highlights.scm @@ -1,6 +1,6 @@ (emphasis) @emphasis.markup (strong_emphasis) @emphasis.strong.markup -(code_span) @text.literal.markup +(code_span) @text.literal.markup ; @raw.markup (strikethrough) @strikethrough.markup [ @@ -11,13 +11,13 @@ (image) ] @link.markup -(link_text) @link_text.markup -(link_label) @link_text.markup +(link_text) @link_text.markup ; @link.markup +(link_label) @link_text.markup ; @link.label.markup -(inline_link ["(" ")"] @link_uri.markup) -(image ["(" ")"] @link_uri.markup) +(inline_link ["(" ")"] @link_uri.markup) ; @link.uri.markup +(image ["(" ")"] @link_uri.markup) ; @link.uri.markup [ (link_destination) (uri_autolink) (email_autolink) -] @link_uri.markup +] @link_uri.markup ; @link.uri.markup diff --git a/crates/languages/src/markdown/highlights.scm b/crates/languages/src/markdown/highlights.scm index 5337fe8371c521..2a45701ac9b7e4 100644 --- a/crates/languages/src/markdown/highlights.scm +++ b/crates/languages/src/markdown/highlights.scm @@ -8,8 +8,8 @@ (atx_heading) (setext_heading) (thematic_break) -] @title.markup -(setext_heading (paragraph) @title.markup) +] @title.markup ; @heading.markup +(setext_heading (paragraph) @title.markup) ; @heading.markup [ (list_marker_plus) @@ -17,7 +17,7 @@ (list_marker_star) (list_marker_dot) (list_marker_parenthesis) -] @punctuation.list_marker.markup +] @punctuation.list_marker.markup ; @punctuation.list.markup (block_quote_marker) @punctuation.markup (pipe_table_header "|" @punctuation.markup) @@ -31,4 +31,4 @@ (fenced_code_block_delimiter) @punctuation.embedded.markup (link_reference_definition) @link.markup -(link_destination) @link_uri.markup +(link_destination) @link_uri.markup ; @link.uri.markup