Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First line of docstring (python) highlighting with default syntax #50

Open
sterliakov opened this issue Jun 27, 2023 · 2 comments
Open

Comments

@sterliakov
Copy link

sterliakov commented Jun 27, 2023

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)

@MattDMo
Copy link
Owner

MattDMo commented Jun 27, 2023

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...

@sterliakov
Copy link
Author

Seems like it was introduced here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants