-
Notifications
You must be signed in to change notification settings - Fork 767
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
Semantic Highlighting for Class Method created by assigning method is wrongly coloured as property
#5111
Comments
#5841 is tracking the possibility of handling this scenario better. |
Agreed with the content discussed in that issue. That might be the different understanding of the name that we are declaring/defining. If that is a design in Pylance, I think it would be better that an option is provided for the user to choose the semantic tag assigned to variable-look but function-inside identifier. (And I am saying this standing on the point of view of a theme designer. For my design, function and variable are coloured differently, as most other themes do. Also, semantic highlighting would bring me better develop experience, especially those languages support functional programming) |
Thanks @debonte and @OzelotVanilla ! |
Following the decision in #6924, the fix here will be to leave the token type unchanged but add the Btw, a note for those of us that know Python better than the semantic tokenization docs... The |
I believe this may be fixed at the same time as as both deal with semantic highlighting of (re-)assigning methods, which should still be picked up as methods. |
They were slightly different, but both will be fixed in our next prerelease build. FYI, we don't close issues until the fix ships, but you can know that a fix is imminent if you see one of the "fixed in next version" labels on the issue. |
This issue has been fixed in prerelease version 2025.2.100, which we've just released. You can find the changelog here: CHANGELOG.md |
Type: Bug
Behaviour
Expected vs. Actual
The method created like
exactlyThisMethod
in this code, will be coloured asproperty
in semantic highlighting, rather thanmethod
.Steps to reproduce:
Use
tkinter
as an example.a = tkinter.Tk()
b = tkinter.Label(a)
b.pack()
pack
will be wrongly coloured asproperty
here.Diagnostic data
python.languageServer
setting: PylanceOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.20.0
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: