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

VS Code fails to highlight syntax properly if type of return value provided #4718

Closed
cx0222 opened this issue Aug 4, 2023 · 3 comments
Closed
Labels
needs repro Issue has not been reproduced yet

Comments

@cx0222
Copy link

cx0222 commented Aug 4, 2023

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.81.0 (Universal)
  • OS Version: macOS 13.4.1 (c), BuildVersion: 22F770820d

Steps to Reproduce:

  1. Select the color scheme "Github Dark";
  2. Create a Python file and write a function with a type hint which indicates the type of the return value; e.g.
# Xuan Chen - Aug 4, 2023

def get_list(some_val: int, other_val: int) -> list[int]:
    return [some_val, other_val]

if __name__ == "__main__":
    # The color of "if" is black, which should be red in this color scheme
    # The color of "__main__" is also black, which should be dark blue in this color scheme
    print(get_list(2023, 8))
  1. I found that some of the lines under the function appear in improper colors.
    Note: This problem occurs no matter which color scheme I select.
    pic1
    pic2
    pic3
@cx0222
Copy link
Author

cx0222 commented Aug 4, 2023

Sorry, I forgot this:
Does this issue occur when all extensions are disabled?: No.

@lramos15 lramos15 transferred this issue from microsoft/vscode Aug 14, 2023
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Aug 14, 2023
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Aug 14, 2023
@Aegis1863
Copy link

Just a supplementary question, whether pylance also fails and keeps showing loading? i got such problem.

@bschnurr bschnurr removed their assignment Jan 4, 2024
@debonte
Copy link
Contributor

debonte commented Mar 1, 2024

I'm not seeing this on our latest prerelease build (2024.2.105). I'm closing this under the assumption that it is fixed. If you are still seeing this behavior, please reopen -- we'll need additional details on how to repro this.

image

@debonte debonte closed this as completed Mar 1, 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

7 participants