Python - separate docstring color? (Used to work)


#1

I had a stylesheet customization for Python docstrings that worked until very recently. I don’t know what happened.

 //Python DocString (Triple-Quoted Strings)
 atom-text-editor.editor .syntax--string.syntax--quoted.syntax--double.syntax--block.syntax--python {
     color: #5e658e;
     font-style: oblique;

      // Quotes themselves
       .syntax--punctuation.syntax--definition {
       color: #5e658e;
      }
    }

Now docstrings are back to looking like regular strings again. Is there a way to fix this?

Thanks!


#2

Hello.

Click to see detail on how and what

The code you are using, I assume is formatted as follows:

atom-text-editor.editor .syntax--string.syntax--quoted.syntax--double.syntax--block.syntax--python {
  color: #5e658e;
  font-style: oblique;

  // Quotes themselves
  .syntax--punctuation.syntax--definition {
    color: #5e658e;
  }
}

The original result looks like:
(looks good!)

Your current result has this as green because the scope changed:
image

If all this fits, then please review recent related topics:
(same cause, different symptom)

Error with syntax colouring (shows where to switch off the Tree Sitter Parser option)


#3

What an amazingly helpful answer, thank you so much.

Turning off the Tree Sitter Parser fixed me up. A shame, this seems to be a neat feature but I won’t be using it if messes up my glorious colors.

Thanks again!


#4

The best feedback the Atom designers can get is if we use their new functionalities and report back to them on it. It is much ground to cover to get it all sorted out, but Tree Sitter is the future that is worth working at, in my opinion.

So please - do use Tree Sitter every now and then and support the effort with your feedback.

Thanks in advance.


#5

update - a new release of Atom is out (V1.32.1)
Your case is not handled yet in tree sitter parser.


#6

You make a cogent point. I will do just that.

And I really appreciate your update about the new Atom version. I’m glad I read your reply before I read the promising-sounding changelog.