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

Pylance is incorrectly assigning my class's setter/getter properties as variable tokens instead of function tokens and its breaking syntax highlighting #6576

Open
0xStarcat opened this issue Oct 18, 2024 · 0 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@0xStarcat
Copy link

0xStarcat commented Oct 18, 2024

Environment data

  • Pylance version: v2024.07.1
  • OS and version: Apple M2 Pro Sequoia 15.0 (24A335)
  • Python version: Python 3.11

Code Snippet

class MyClass:
    def __init__(self):
        self._x = None

    @property
    def x(self):
        return self._x

    @x.setter
    def x(self, value):
        self._x = value

Repro

  • "python.languageServer": "Pylance"
  • "editor.semanticHighlighting.enabled": true,
  • "workbench.colorTheme": "Default Dark+",

Expected behavior

Function x under @property should be yellow

Function x under @x.setter should be yellow

Decorator x within x.setter should be green

Actual behavior

Image

Logs

Function and decorator x are being tokenized the same as a variable

Image

Other extensions

Tested with no other extensions, only Python + Pylance

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants