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

pandas/numpy specific colorization #5

Open
gokturksm opened this issue Jul 3, 2020 · 2 comments
Open

pandas/numpy specific colorization #5

gokturksm opened this issue Jul 3, 2020 · 2 comments
Labels
enhancement ✨ New feature or request

Comments

@gokturksm
Copy link

gokturksm commented Jul 3, 2020

Hello. So I'm currently using this theme, and out of all the themes I like, there is always a little thing bothering me. The thing is when using pandas/numpy there are some functions/methods/things? that don't go super-along with the idea of Python colorization in themes. The most obvious example is .iloc and .loc indexers. So I'm using some scopes that does not defined in most of the themes, and I want this magnificent theme to have these additions as well. Maybe as an another option like italic, maybe not.

So I have these colorization ideas, and it's best to show them via screenshots. Here it is. Proposed ones are in red color.

Before:
image
After
image

There are lots of changes but it's, of course, open to discussion which ones may be suitable to be added to the theme.

Here's the customizations soup... I'll add names and descriptions to each if any or some of them seems suitable. I'm aware there are so many colors that it'll become confusing. So .loc, .iloc and : in loc and iloc indexes shoud be enough as well, maybe? I don't know, so there is the issue. Can I tag the issue? I don't know yet, so we'll see. (It seems I can't tag the issue.)

Sincerely.

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "source.python meta.member.access.python meta.item-access.python meta.indexed-name.python",
                "settings": {
                    "foreground": "#ebcb8b"
                }
            },
            {
                "scope": [
                    "source.python meta.member.access.python meta.function-call.python meta.function-call.arguments.python meta.member.access.python meta.attribute.python",
                    "source.python meta.member.access.python meta.item-access.python meta.item-access.arguments.python meta.member.access.python meta.attribute.python",
                ],
                "settings": {
                    "foreground": "#eb8bab"
                }
            },
            {
                "scope": [
                    "source.python meta.member.access.python meta.attribute.python",
                ],
                "settings": {
                    "foreground": "#eb8bdb"
                }
            },
            {
                "scope": [
                    "source.python meta.member.access.python meta.function-call.python meta.function-call.arguments.python",
                    "source.python meta.function-call.python meta.function-call.arguments.python",
                ],
                "settings": {
                    "foreground": "#efd5fc"
                }
            },
            {
                "scope": [
                    "source.python keyword.control.flow.python",
                ],
                "settings": {
                    "foreground": "#f62196"
                }
            },
            {
                "scope": [
                    "string.quoted.docstring",
                ],
                "settings": {
                    "foreground": "#B4DC7F"
                }
            },
            {
                "scope": "source.python meta.member.access.python meta.function-call.python meta.function-call.arguments.python string.quoted.single.python",
                "settings": {
                    "foreground": "#97EE91"
                }
            },
            {
                "scope": "constant.language.python",
                "settings": {
                    "foreground": "#A267F5"
                }
            }
        ]
    },
@trallard
Copy link
Owner

trallard commented Nov 7, 2020

Sorry for only getting back to this.

So just to get this right, you'd prefer if the italicised items were also to be of a different colour? if so it might be enough with assigning a different foreground to source.python meta.member.access.python I might need to do some testing.
Out of curiosity have you found any themes that do this well? I am assuming maybe not from your comment above:

and out of all the themes I like, there is always a little thing bothering me

Also, for constants like True, False, None I agree these should be changed to improve legibility.
@gokturksm would you like to work on this together? Might make the scientific computing experience better and I appreciate the feedback

@trallard trallard added the enhancement ✨ New feature or request label Nov 7, 2020
@gokturksm
Copy link
Author

Thanks for the reply. Yes, I'd prefer italicized items with different colors. It would be easy to just alter source.python meta.member.access.python, however, that'd be not scientific computing specific. While using pandas for example, .iloc should be distinguishable in my opinion. I did implement what I tried to do in a theme called Nebula where I created a new theme in the marketplace. It is not the best solution in my opinion. There is no need for blabla Pandas for all the themes. So it might be an option for this theme, like italic. Maybe it'd become mainstream later on, I have no idea; though I'd like to work on this together for sure. Glad you're interested @trallard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants