MagicPython icon indicating copy to clipboard operation
MagicPython copied to clipboard

function invocation not colored consistently

Open aeschli opened this issue 6 years ago • 14 comments

bar = 1

def foo():
    pass

foo()
bar += 1

vscode

image

Most theme's don't colorize meta.function-call as the idea is that it should cover function names, including the full path, and all parameters (see https://www.sublimetext.com/docs/3/scope_naming.html)

I good scope to give function names is support.function

aeschli avatar Feb 16 '18 15:02 aeschli

Is this going to be fixed any time soon? also, what about method calls? can we get these colroed as well?

contang0 avatar Dec 05 '18 17:12 contang0

Is this going to be fixed any time soon? also, what about method calls? can we get these colroed as well?

Keep in mind for now you could highlight function calls by adding your own override in User settings by something like

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "meta.function-call.generic",
                "settings": {
                    "foreground":"#A6E22E"
                }
            }
        ]
    }

No option to do separate method call coloring for now unfortunately.

Adanteh avatar Jan 16 '19 16:01 Adanteh

Keep in mind for now you could highlight function calls by adding your own override in User settings by something like

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "meta.function-call.generic",
                "settings": {
                    "foreground":"#A6E22E"
                }
            }
        ]
    }

No option to do separate method call coloring for now unfortunately.

@Adanteh I tried adding this to my settings.json but still no change to the function call color..

honkeat avatar Jul 12 '19 18:07 honkeat

Keep in mind for now you could highlight function calls by adding your own override in User settings by something like

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "meta.function-call.generic",
                "settings": {
                    "foreground":"#A6E22E"
                }
            }
        ]
    }

No option to do separate method call coloring for now unfortunately.

@Adanteh I tried adding this to my settings.json but still no change to the function call color..

@honkeat you probably placed the code in the wrong scope. It should look like this:

image

image

contang0 avatar Jul 23 '19 08:07 contang0

@honkeat you probably placed the code in the wrong scope. It should look like this:

Still doesn't work for me. Any reason why this isn't set by default, this is the only IDE I've used with this issue.

matt-fleming avatar Aug 06 '19 13:08 matt-fleming

@matt-fleming the extension "Python for VSCode" was what restricted the function coloring. After disabling it and adding the overwrite from the top everything worked fine

mkflow27 avatar Aug 17 '19 14:08 mkflow27

Can we add proper instructions on the overwrite workaround? This would be very helpful.

yeamusic21 avatar Oct 18 '19 13:10 yeamusic21

Every function and method call is marked by meta.function-call.python scope, that includes the entire call signature. For every function and method call the name is marked by meta.function-call.generic.python or by support.function.builtin.python for builtins. The logic is that functions and methods are pretty much common bread-and-butter things that probably should be easily distinguished from builtins in most color themes. Since default color themes tend to highlight support.function but not builtin or support.function.builtin specifically that's the reason for the choices of scope names.

As for overriding the color themes, there are some instructions here. They do boil down to what has already been proposed in this thread:

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "meta.function-call.generic",
                "settings": {
                    "foreground":"#A6E22E"
                }
            }
        ]
    }

vpetrovykh avatar Oct 18 '19 16:10 vpetrovykh

why this problem has not been fixed for 2 years.

setanarut avatar Nov 30 '20 20:11 setanarut

I hope this problem has not been forgotten

techtanic avatar Apr 15 '21 17:04 techtanic

Its been ~3 years and this issue is still open ( T _ T ) . Please FIX this ...

gokulkannant avatar Aug 29 '21 17:08 gokulkannant

I condemn Visual Studio Code developers and Microsoft for delaying this issue for 4 years and pointing people to this abandoned repository.

setanarut avatar Mar 14 '22 20:03 setanarut

https://marketplace.visualstudio.com/items?itemName=evgeniypeshkov.syntax-highlighter is an alternative if you're not using pylance

Real-Gecko avatar Apr 19 '22 09:04 Real-Gecko

@Real-Gecko Ty very much for your answer ! It's Working !

Leximor avatar Apr 08 '24 16:04 Leximor