Syntax highlighting different after reboot


#1

After rebooting the system the syntax highlighting for python has changed. Anything before a period is colored the same (white previously) and method calls after a period are changed.

https://i.imgur.com/jsE8N3H.jpg

Before, the test.t would be white as well as the time.sleep. I’m using the One Dark syntax theme but I tried changing themes and the same result.

Any ideas what went wrong or how to fix it? Any help appreciated.

On OSX with Atom 1.25


#2

Does it happen is safe mode? What other Python language packages do you have installed (e.g., it could be magicpython)? Or it could be caused by the new tree-sitter grammars.

Tell us the safe mode part first, and then try with the Core setting “use tree sitter parsers” disabled (if not already).


#3

I didn’t know about safe mode but it’s giving the same syntaximgur.com/zn4xdJi.jpg

I checked in the core options and use tree sitter parsers was disabled.


#4

From the Atom 1.25 announcement:

The Python and HTML language packages got some love in this release. When editing Python source, the tokenizer now supports function annotations, async functions, string formatting, f-strings, and binary strings.


#5

I didn’t realize it was a new version of Atom. So the syntax highlighting for python was changed? Is there a way to go back to what it was?


#6

Still not sure how to fix this. Is this normal with the update? I’m not using the the use tree sitter parsers option.


#7

Yes, this is expected behavior. You can get back the previous behavior if you’d like by adding the following to your ~/.atom/styles.less file:

@import 'syntax-variables.less'

.syntax--python {
  &.syntax--variable, &.syntax--entity.syntax--name.syntax--function {
    color: @syntax-text-color;
  }
}

#8

This did fix it. Thank you, I appreciate the help.