cobalt2-vscode
cobalt2-vscode copied to clipboard
Add Functionality for Python Decorators
Hello! I hope you like this contribution! If you want any changes let me know :)
All I did was add some recognition for decorators in Python.
Before:
After:
Hello @VoxelMC, thanks for your contribution. These days I've struggled to make cobalt2 to be more compatible with Python (I'm new to this language).
I'm glad to find our thoughts coincide. With your commit I find it impossible to highlight builtin function decorators, including @staticmethod
, @classmethod
and @property
(maybe more? I'm not sure). That's because these builtin decorators use different textmate scopes.
Besides, I'm trying to add some Python semantic token (provided by the extension Pylance) supports to the theme recently.
Hello @VoxelMC,
To deal with the problem I mentioned yesterday, I suggest also adding rules to semanticTokenColors
field. Here is an example.
"semanticTokenColors": {
// ...
"*.decorator": {
"fontStyle": "italic bold" // I prefer bold to underline
},
}
It looks great for Python. But till now I'm not sure whether this patch would affect other languages.
Hello @VoxelMC,
To deal with the problem I mentioned yesterday, I suggest also adding rules to
semanticTokenColors
field. Here is an example."semanticTokenColors": { // ... "*.decorator": { "fontStyle": "italic bold" // I prefer bold to underline }, }
It looks great for Python. But till now I'm not sure whether this patch would affect other languages.
Hello @Eitheages, its nice to meet you! I have been busy moving as of late, but I would love to explore this further with you. I like cobalt2 in general and have just started working a lot more in python and I notice a lot of possible semantics improvements. I love the suggestion that you make here, it looks way better than what I proposed.
I will let you know when I get back on this train!