MagicPython icon indicating copy to clipboard operation
MagicPython copied to clipboard

Add scope for function parameter used inside function

Open Cielquan opened this issue 5 years ago • 1 comments

Got send here from 'vscode-python' https://github.com/microsoft/vscode-python/issues/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

Cielquan avatar May 06 '20 17:05 Cielquan

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

Cielquan avatar Dec 03 '20 17:12 Cielquan