MagicStack / MagicPython

Cutting edge Python syntax highlighter for Sublime Text, Atom and Visual Studio Code. Used by GitHub to highlight your Python code!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add scope for function parameter used inside function

Cielquan opened this issue · comments

Got send here from 'vscode-python' microsoft/vscode-python#11594

def function(param1):
    x = 1
    return param1 * x

Both x and param1 are variables used inside the function, but param1 is a given parameter.

In the function def line param1 has a special scope but not when used inside the function.
I'd like to have it have a special textmate scope too so I can color it and see, when I use a parameter and when a 'normal' variable.

The left side is what I want (from PyCharm) and the right side is as currently is.
image

Workaround: the new Pylance language server adds semantic highlighting which "fixes" this: https://github.com/microsoft/pylance-release#semantic-highlighting