pylance-release
pylance-release copied to clipboard
Pylance is incorrectly assigning my class's setter/getter properties as variable tokens instead of function tokens and its breaking syntax highlighting
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
Logs
Function and decorator x are being tokenized the same as a variable
Other extensions
Tested with no other extensions, only Python + Pylance