Skip to content

Commit deb3d2f

Browse files
authored
Improved syntax highlighting support for Rust (#240)
Improved syntax highlighting support for Rust The syntax highlighting for Rust [1] has been improved: 1. Use `nord7` as foreground color for entity types. 2. Use `nord8` as foreground color with bold font for macros [2] to make them visually different from "normal" functions. 3. Use `nord10` for attributes [3] and derives [4]. 4. Use `nord13` for interpolation brackets to match the color for regular expression and special tokens in strings. 5. As a result of list item 1, import statements and paths are correctly colored with keyword and type colors. 6. Use the correct highlighting for traits [5] by making the font bold. [1]: https://www.rust-lang.org [2]: https://doc.rust-lang.org/1.8.0/book/macros.html [3]: https://doc.rust-lang.org/reference/attributes.html [4]: https://doc.rust-lang.org/book/ch19-06-macros.html#how-to-write-a-custom-derive-macro [5]: https://doc.rust-lang.org/book/ch10-02-traits.html Co-authored-by: Arctic Ice Studio <development@arcticicestudio.com> Co-authored-by: Sven Greb <development@svengreb.de> Resolves GH-167
1 parent 92e73bd commit deb3d2f

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

themes/nord-color-theme.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,46 @@
12151215
"foreground": "#81A1C1"
12161216
}
12171217
},
1218+
{
1219+
"name": "[Rust] Entity types",
1220+
"scope": "source.rust entity.name.type",
1221+
"settings": {
1222+
"foreground": "#8FBCBB"
1223+
}
1224+
},
1225+
{
1226+
"name": "[Rust] Macro",
1227+
"scope": "source.rust meta.macro entity.name.function",
1228+
"settings": {
1229+
"fontStyle": "bold",
1230+
"foreground": "#88C0D0"
1231+
}
1232+
},
1233+
{
1234+
"name": "[Rust] Attributes",
1235+
"scope": [
1236+
"source.rust meta.attribute",
1237+
"source.rust meta.attribute punctuation",
1238+
"source.rust meta.attribute keyword.operator"
1239+
],
1240+
"settings": {
1241+
"foreground": "#5E81AC",
1242+
}
1243+
},
1244+
{
1245+
"name": "[Rust] Traits",
1246+
"scope": "source.rust entity.name.type.trait",
1247+
"settings": {
1248+
"fontStyle": "bold"
1249+
}
1250+
},
1251+
{
1252+
"name": "[Rust] Interpolation Bracket Curly",
1253+
"scope": "source.rust punctuation.definition.interpolation",
1254+
"settings": {
1255+
"foreground": "#EBCB8B",
1256+
}
1257+
},
12181258
{
12191259
"name": "[SCSS] Punctuation Definition Interpolation Bracket Curly",
12201260
"scope": [

0 commit comments

Comments
 (0)