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 invocation not colored consistently #127

Open
aeschli opened this issue Feb 16, 2018 · 14 comments
Open

function invocation not colored consistently #127

aeschli opened this issue Feb 16, 2018 · 14 comments

Comments

@aeschli
Copy link

aeschli commented Feb 16, 2018

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 aeschli changed the title fucntion invocation not colored consistently function invocation not colored consistently Feb 16, 2018
@contang0
Copy link

contang0 commented Dec 5, 2018

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

@Adanteh
Copy link

Adanteh commented Jan 16, 2019

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.

@honkeat
Copy link

honkeat commented Jul 12, 2019

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..

@contang0
Copy link

contang0 commented Jul 23, 2019

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

@matt-fleming
Copy link

@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.

@mkflow27
Copy link

mkflow27 commented Aug 17, 2019

@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

@yeamusic21
Copy link

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

@vpetrovykh
Copy link
Member

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"
                }
            }
        ]
    }

@setanarut
Copy link

why this problem has not been fixed for 2 years.

@techtanic
Copy link

I hope this problem has not been forgotten

@gokulkannant
Copy link

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

@setanarut
Copy link

setanarut commented Mar 14, 2022

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

@Real-Gecko
Copy link

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

@Leximor
Copy link

Leximor commented Apr 8, 2024

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

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