one-dark / vscode-one-dark-theme

One Dark theme for VS Code.
https://marketplace.visualstudio.com/items?itemName=mskelton.one-dark-theme
ISC License
50 stars 8 forks source link

User Class methods calls and variables aren't colored in python #39

Closed Sacek073 closed 2 years ago

Sacek073 commented 2 years ago

image What bothers me is that child.value is not colored and same for source.get_name() and target.get_name() On left VS Code, on right Atom. The yellow and blue difference of BattleCommand doesnt bother me, same with "=".

Something like "meta.member.access meta.function-call" in scope of "Malibu" could help, but it breaks other stuff.

mskelton commented 2 years ago

Thanks for the report. I've added meta.function-call.generic to Malibu which fixes the function calls, I'm not sure about changing member access as I think that might have a larger impact that I would like. Do you have the Python extension installed and semantic highlighting enabled? That will help out tremendously and this theme is built with semantic highlighting at the top of mind.

Sacek073 commented 2 years ago

Hi thank you for fast reply. I have semantic highlighting enabled image

This is list of my extensions: image

mskelton commented 2 years ago

Could you share a repo with a reproducible example of your code?

Sacek073 commented 2 years ago

Hi, there is short not working snippet, that could give you an idea. It is not ideal for me to share this code, I'm sorry.

class AI:
    def __init__(self, player_name, board, players_order, max_transfers):
        self.player_name = player_name

    class Node:
        def __init__(self, value, player):
            self.value = value 

        def child_best_get(self):
            for child in self.childs:
                if (child.best == self.best).all():
                    return child

    def gen_attacks(self, node, depth):
        return node

    def ai_turn(self, board, nb_moves_this_turn, nb_transfers_this_turn, nb_turns_this_game, time_left):
        root = self.gen_attacks(self.Node(board, self.player_name), 3) #root is node

        child = root.child_best_get() # child is also class Node
        (b, source, target) = child.value #<-- here is problem!!!!!
mskelton commented 2 years ago

Seems a bit of an edge case so I'm going to leave it as is for now to prevent accidentally breaking other languages.

Sacek073 commented 2 years ago

Yeah, that seems reasonable. Thank you for your help.