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