Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Conversation

@chbk
Copy link
Contributor

@chbk chbk commented Mar 17, 2020

Description of the Change

This is an update of the default syntax themes to implement naming conventions for syntax scopes.

This PR simply adds the template to each theme with custom colors, to accommodate the naming conventions. There should be no break in compatibility with existing grammars.

As naming conventions are implemented in more language grammars, their old specific stylesheets can be retired.

Possible Drawbacks

Some colors are changed to stay consistent between languages and to follow the design guidelines by @maxbrunsfeld regarding color choices.

Verification Process

  • Tested all the themes with the language grammar PRs linked below.

Release Notes

  • Add naming conventions to default syntax themes

Applicable Issues

Related Pull Requests

@chbk
Copy link
Contributor Author

chbk commented Aug 4, 2020

Here are some previews of the improvements brought by this PR. For each theme, notice the differences before and after implementing the naming conventions. Syntax highlighting is really harmonized across languages.

Solarized Dark:
solarized-dark

One Dark:
one-dark

Base16 Tomorrow Dark:
base16-dark

Atom Dark:
atom-dark

Solarized Light:
solarized-light

One Light:
one-light

Base16 Tomorrow Light:
base16-light

Atom Light:
atom-light

Python:

class Lilac(Tree):

  flowers: bool


  def bloom(self, days: int) -> float:
    self.flowers = True
    return float(days) / 7



if __name__ == "__main__":

  season: Final[str] = "winter \n"
  lilac: Lilac = None

  if season[0] == 'w' and lilac == None:
    snow = "*"

C++:

class Lilac: public Tree {

  bool flowers;


  float bloom(int days) {
    this->flowers = true;
    return (float) days / 7;
  }
};

int main() {

  const char *season = "winter \n";
  Lilac *lilac = nullptr;

  if (season[0] == 'w' && lilac == nullptr) {
    auto snow = "*";
  }
}

Go:

type Lilac struct {
  Tree
  flowers bool
}

func (lilac Lilac) bloom(days int) float32 {
  lilac.flowers = true
  return float32(days) / 7
}


func main() {

  const season string = "winter \n"
  var lilac *Lilac = nil

  if season[0] == 'w' && lilac == nil {
    snow := "*"
  }
}

@aminya
Copy link
Contributor

aminya commented Jan 12, 2021

@chbk I am so glad to see this PR. 🚀

@chbk chbk marked this pull request as ready for review February 1, 2021 14:33
Copy link
Contributor

@sadick254 sadick254 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to the Atom community @chbk and congratulations on your first contribution to the Atom repo. You have done an excellent job on this PR. Hopping to see more from you @chbk .

@sadick254 sadick254 merged commit eb064bf into atom:master Feb 19, 2021
@chbk
Copy link
Contributor Author

chbk commented Feb 19, 2021

Thanks @sadick254, it's great to see this merged!

@ElderTugBoat786
Copy link

Hi, after the last update the '$' symbol in a php file when the One Dark syntax theme are select is white and not red.
I have open a issue atom/language-php#423 but after a discussion we think this pr is the source of problem.

To temporaney solve the problem i have add
.syntax--punctuation.syntax--definition.syntax--variable.syntax--php { color: e06c75; }
to my style.less file.

@KapitanOczywisty suggested the change this file https://github.com/atom/atom/blob/master/packages/one-dark-syntax/styles/syntax-legacy/php.less add a specific rules fort this case. If this is the problem I can try to do a PR on that file to fix it

Thanks

@chbk
Copy link
Contributor Author

chbk commented Apr 17, 2021

Hi @ElderTugBoat786, thanks for pointing that out. The purpose of this PR (and related PRs) is to harmonize syntax highlighting across languages, so the color change is an intended consequence. Punctuation marks should be white with the One Dark theme. Variables in PHP should be white as well, like in other languages. Eventually they will be when the legacy stylesheets are retired, but I don't know what the maintainers' plans are with the naming conventions.

@curtiscarlson
Copy link

This is not the only thing that changed. now when you double click a variable, it highlights the name with the $. Yesterday, it only highlighted the text part of the variable name, which was really really useful.

@KapitanOczywisty
Copy link

@curtiscarlson Theme is not responsible for that. There was mentioned issue, but it was initially fixed in #21910 . However after that it was introduced directly: atom/language-php#412 and merged without any discussion. You can fix that of course by editing language-php options, but this is still annoying how they are merging dumb stuff like that.

@ThatXliner
Copy link
Contributor

Can't you configure it?

@KapitanOczywisty
Copy link

@ThatXliner Yes, you can change it. My problem is that they changed default configuration based on some issue with 3-rd party extension, which is crazy.

mquevill added a commit to mquevill/monokai that referenced this pull request May 26, 2021
Based on atom/atom#20524. Keeping the "legacy" definitions is useful while the language grammars have not been fully merged in.
mquevill added a commit to mquevill/monokai that referenced this pull request May 26, 2021
Based on atom/atom#20524. Keeping the "legacy" definitions is useful while the language grammars have not been fully merged in.
mquevill added a commit to mquevill/monokai that referenced this pull request May 26, 2021
Based on atom/atom#20524. Keeping the "legacy" definitions is useful while the language grammars have not been fully merged in.
mquevill added a commit to mquevill/monokai that referenced this pull request May 26, 2021
Based on atom/atom#20524. Keeping the "legacy" definitions is useful while the language grammars have not been fully merged in.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants