Neon-color-scheme icon indicating copy to clipboard operation
Neon-color-scheme copied to clipboard

First line of docstring (python) highlighting with default syntax

Open sterliakov opened this issue 1 year ago • 2 comments

Recently (well, not really, it's been several months) ST python syntax was updated. Among other, the following change was introduced that looks quite unexpected: first docstring line now gets comment.block.documentation.summary.python scope (after generic source.python, only two scopes in total). This results in first line being gray-colored, like usual # comment.

I added the following style for myself (the color here matches the color of triple quotes around docstring):

{
	"name": "Python docstring first line",
	"scope": "comment.block.documentation.summary",
	"foreground": "#FF06A5",
	"font_style": "bold italic"
}

Examples:

def foo() -> int:
    """Do something very important."""

def bar(x):
    """And even more important.
   
    This means we'll even have to explain, probably. Like this.
    """

def baz():
    """
    And even if I'm too long, I'm still the Most Important Line, but below.

    And I am not any more.
    """

def qux():
    """
    And any linebreak matters.
    So I'm next line and do not have a separate scope.
    """

(and thanks for this theme! It's really brilliant, I can't look at most other themes after discovering this one)

sterliakov avatar Jun 27 '23 20:06 sterliakov

Thanks for the bug report! Do you know approximately when the change was introduced? I'd like to look into its history.

At any rate, let me push out a new version of Neon with this change. There might be a couple others as well, I haven't done a release in a little while...

MattDMo avatar Jun 27 '23 20:06 MattDMo

Seems like it was introduced here

sterliakov avatar Jun 27 '23 22:06 sterliakov