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

Function declaration and arguments don't highlight in Python with Generic Type Variables #169

Open
Snaptraks opened this issue Oct 15, 2024 · 0 comments

Comments

@Snaptraks
Copy link

The highlighting of Python function name and arguments in the declaration are not coloured if using a generic type variable in the function declaration.

Sample code

from typing import TypeVar


T = TypeVar("T")

def function(values: list[T]) -> None:
    for val in values:
        print(val)


def other_function[X](values: list[X]) -> None:
    for val in values:
        print(val)

Filename and Language selected

Python file (.py) and Python language selected

Atom Original theme Screenshot

The feature did not exist prior to Atom being discontinued, therefore the syntax highlighting does not work either.

image

VSCode theme Screenshot

[VSCode screeshot showing how the coloring is]
image

Versions used

  • VSCode:

    • Version: 1.94.1 (user setup)
    • Commit: e10f2369d0d9614a452462f2e01cdc4aa9486296
    • Date: 2024-10-05T05:44:32.189Z
    • Electron: 30.5.1
    • ElectronBuildId: 10262041
    • Chromium: 124.0.6367.243
    • Node.js: 20.16.0
    • V8: 12.4.254.20-electron.0
    • OS: Windows_NT x64 10.0.19045
  • Theme version: v2.3.0

Extra information

Relevant extensions:

  • Python v2024.16.1
  • Pylance v2024.10.1
  • Ruff v2024.50.0
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