theme_importer: Improve syntax token matching (#3549)
This PR improves the approach we use to match syntax tokens between Zed and VS Code in the `theme_importer`. We now use the list of scopes assigned to each Zed syntax token to rank the possible candidates in the VS Code and then pick the candidate with the highest rank. So far this has proved to provide better colors across the board, but we'll continue to refine the matching over time. Release Notes: - N/A
This commit is contained in:
parent
89f62a1a69
commit
f272881a6b
14 changed files with 520 additions and 405 deletions
|
@ -89,6 +89,14 @@ pub fn palenight() -> UserThemeFamily {
|
|||
..Default::default()
|
||||
},
|
||||
),
|
||||
(
|
||||
"comment.doc".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0x697098ff).into()),
|
||||
font_style: Some(UserFontStyle::Italic),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
(
|
||||
"constant".into(),
|
||||
UserHighlightStyle {
|
||||
|
@ -164,7 +172,7 @@ pub fn palenight() -> UserThemeFamily {
|
|||
(
|
||||
"punctuation".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0xc792eaff).into()),
|
||||
color: Some(rgba(0x89ddffff).into()),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
|
@ -206,7 +214,7 @@ pub fn palenight() -> UserThemeFamily {
|
|||
(
|
||||
"variable".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0xffcb6bff).into()),
|
||||
color: Some(rgba(0xff5572ff).into()),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
|
@ -296,6 +304,14 @@ pub fn palenight() -> UserThemeFamily {
|
|||
..Default::default()
|
||||
},
|
||||
),
|
||||
(
|
||||
"comment.doc".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0x697098ff).into()),
|
||||
font_style: Some(UserFontStyle::Italic),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
(
|
||||
"constant".into(),
|
||||
UserHighlightStyle {
|
||||
|
@ -371,7 +387,7 @@ pub fn palenight() -> UserThemeFamily {
|
|||
(
|
||||
"punctuation".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0xc792eaff).into()),
|
||||
color: Some(rgba(0x89ddffff).into()),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
|
@ -413,7 +429,7 @@ pub fn palenight() -> UserThemeFamily {
|
|||
(
|
||||
"variable".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0xffcb6bff).into()),
|
||||
color: Some(rgba(0xff5572ff).into()),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
|
@ -503,6 +519,14 @@ pub fn palenight() -> UserThemeFamily {
|
|||
..Default::default()
|
||||
},
|
||||
),
|
||||
(
|
||||
"comment.doc".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0x697098ff).into()),
|
||||
font_style: Some(UserFontStyle::Italic),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
(
|
||||
"constant".into(),
|
||||
UserHighlightStyle {
|
||||
|
@ -578,7 +602,7 @@ pub fn palenight() -> UserThemeFamily {
|
|||
(
|
||||
"punctuation".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0xc792eaff).into()),
|
||||
color: Some(rgba(0x89ddffff).into()),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
|
@ -620,7 +644,7 @@ pub fn palenight() -> UserThemeFamily {
|
|||
(
|
||||
"variable".into(),
|
||||
UserHighlightStyle {
|
||||
color: Some(rgba(0xffcb6bff).into()),
|
||||
color: Some(rgba(0xff5572ff).into()),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue