You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if you are interested in better Rust syntax highlight.
As suggested by your issue template I want to make sure you are opened to new pull requests for this feature and if my idea fits with the scope of this color scheme.
(This repository has some pull request still waiting for review, is it fine for you that I had a PR on the stack?)
Description
JetBrains IDE (especially IntelliJ/CLion) is one of the mainstream IDE for Rust language development (due to the Rust plugin).
The main idea is to provide a possibly better Rust syntax highlight than the current one.
In the following sections I describe some of the possible improvements. All of them are of course opinion-based and I would like to have a review for some or guidelines for others. Thanks.
Format
For each section, a rust example code is presented and if available a screenshot of suggested change(s). Left is the actual Nord theme, Right is the suggested change.
Methods: abscissa() or ordinate() (function taking self, &self or &mut self as first parameter)
Function: hello_world() (standard function)
Function-like macro: println!()
The main idea is to unify all these "functions" to a single Nord color (nord8#88C0D0).
The actual nord theme use #FFC66D for function/method call and #4EADE5 for macro.
Generics and lifetimes
Rust provides generics and lifetimes (for reference validation):
#[derive(Debug)]structPoint<'a,T>{name:&'astr,x:T,y:T,}impl<'a,T>Point<'a,T>whereT:Copy,{fnnew(name:&'astr,x:T,y:T) -> Self{Point{ name, x, y }}}fnmain(){let pi = String::from("π");let point = Point::new(&pi,1.1,4.2);println!("point = {:?}", point);}
The main idea here is to unify generics/lifetime and coherence with generics of other language using nord7#8fbcbb.
Italic font differentiate lifetime(s) from generic(s).
The actual Nord theme use #20999D for generics and lifetime.
Mutable variables/parameters
In rust all variables/parameters are immutable by default. Variables/parameters can be annotated with mut to make them mutable. The actual Nord theme underline the mutable variables/parameters.
The main idea here is to reserve nord15#b48ead for numbers only and just use nord4#d8dee9 for underline.
Enums
In rust Enum-s are similar to algebraic data types and Enum variant(s) are first class citizens.
#[derive(Debug)]enumNumber{Signed(i64),Unsigned(u64),Float(f64),}fnmain(){let number = Number::Float(3.14);println!("number = {:?}", number);let number = Number::Signed(-1);println!("number = {:?}", number);let number = Number::Unsigned(42);println!("number = {:?}", number);}
The main idea is to identify Enum variants like any other types.
Italic font differentiate Structure type from Enum variant(s).
Fields
Last point is the field(s) color.
structStructure{field:(),}
Disclaimer: If this issue leads to a pull request I will not include a change for this
I know that the Nord theme documentation states:
Nord 4
[...]
In the context of syntax highlighting it is used as text color for variables, constants, attributes and fields.
However identifying structure/structure enum variant field can be handy. Which Nord color do you recommend for fields if I want to highlight them? Thanks
Notes
If needed, I can update this issue and add more content. The main goal is to launch a discussion around the Rust syntax. Let me know if you are interested in these (or part of these) changes and I will submit a pull request accordingly.
Hi!
I would like to know if you are interested in better Rust syntax highlight.
As suggested by your issue template I want to make sure you are opened to new pull requests for this feature and if my idea fits with the scope of this color scheme.
(This repository has some pull request still waiting for review, is it fine for you that I had a PR on the stack?)
Description
JetBrains IDE (especially IntelliJ/CLion) is one of the mainstream IDE for Rust language development (due to the Rust plugin).
The main idea is to provide a possibly better Rust syntax highlight than the current one.
In the following sections I describe some of the possible improvements. All of them are of course opinion-based and I would like to have a review for some or guidelines for others. Thanks.
Format
For each section, a rust example code is presented and if available a screenshot of suggested change(s).
Left is the actual Nord theme, Right is the suggested change.
Functions
Rust provides four different "function" types:
new()
("static functions")abscissa()
orordinate()
(function takingself
,&self
or&mut self
as first parameter)hello_world()
(standard function)println!()
The main idea is to unify all these "functions" to a single Nord color (
nord8
#88C0D0
).The actual nord theme use
#FFC66D
for function/method call and#4EADE5
for macro.Generics and lifetimes
Rust provides generics and lifetimes (for reference validation):
The main idea here is to unify generics/lifetime and coherence with generics of other language using
nord7
#8fbcbb
.Italic font differentiate lifetime(s) from generic(s).
The actual Nord theme use
#20999D
for generics and lifetime.Mutable variables/parameters
In rust all variables/parameters are immutable by default. Variables/parameters can be annotated with
mut
to make them mutable. The actual Nord theme underline the mutable variables/parameters.The main idea here is to reserve
nord15
#b48ead
for numbers only and just usenord4
#d8dee9
for underline.Enums
In rust Enum-s are similar to algebraic data types and Enum variant(s) are first class citizens.
The main idea is to identify Enum variants like any other types.
Italic font differentiate Structure type from Enum variant(s).
Fields
Last point is the field(s) color.
Disclaimer: If this issue leads to a pull request I will not include a change for this
I know that the Nord theme documentation states:
However identifying structure/structure enum variant field can be handy. Which Nord color do you recommend for fields if I want to highlight them? Thanks
Notes
If needed, I can update this issue and add more content. The main goal is to launch a discussion around the Rust syntax. Let me know if you are interested in these (or part of these) changes and I will submit a pull request accordingly.
Relevant issue in other ports
nordtheme/visual-studio-code#167
The text was updated successfully, but these errors were encountered: