The Wayback Machine - https://web.archive.org/web/20201206081225/https://github.com/MagicStack/MagicPython/issues/127
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 · 9 comments
Open

function invocation not colored consistently #127

aeschli opened this issue Feb 16, 2018 · 9 comments

Comments

@aeschli
Copy link

@aeschli 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
@juliuscrn
Copy link

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

@juliuscrn
Copy link

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

@matt-fleming matt-fleming commented Aug 6, 2019

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

@mcquardt
Copy link

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

@yeamusic21 yeamusic21 commented Oct 18, 2019

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

@vpetrovykh
Copy link
Member

@vpetrovykh vpetrovykh commented Oct 18, 2019

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"
                }
            }
        ]
    }
@hazarek
Copy link

@hazarek hazarek commented Nov 30, 2020

why this problem has not been fixed for 2 years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants
You can’t perform that action at this time.