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

Weird decorators highlighting with default python syntax #51

Open
sterliakov opened this issue Jul 4, 2023 · 0 comments
Open

Weird decorators highlighting with default python syntax #51

sterliakov opened this issue Jul 4, 2023 · 0 comments

Comments

@sterliakov
Copy link

sterliakov commented Jul 4, 2023

Let's begin with an image:

Screenshot

I know for sure this change was introduced last year and is annoying me already for a while. Previously decorators used to be highlighted fully, including dotted paths. This looks annoying, especially for properties, but I'm ready to accept "works as intended" resolution too:)

Scopes are assigned as follows:

  • Line start: source.python meta.annotation.python punctuation.definition.annotation.python
  • "at" sign and lone decorator name: source.python meta.annotation.python variable.annotation.python
  • dotted path: source.python meta.annotation.python meta.path.python meta.generic-name.python
  • period in path: source.python meta.annotation.python meta.path.python punctuation.accessor.dot.python
  • last path component: source.python meta.annotation.python meta.path.python variable.annotation.python

Tbh, this smells like a bug in ST syntax (why does variable.annotation.python not apply to qualifying components?) - if you agree, I'll address this question to ST team instead.

Code to reproduce:

@deco
def foo(x): pass


@foo.deco
def bar(x): pass


class A:
	@property
	def foo(x): pass

	@foo.setter
	def foo(x): pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant