Open chbk opened 4 years ago
Preview of the changes with Atom's default syntax themes:
Without naming conventions (current Tree-sitter grammar) |
With naming conventions in theme and Tree-sitter grammar |
---|---|
Solarized Dark |
Solarized Dark |
One Dark |
One Dark |
Base16 Tomorrow Dark |
Base16 Tomorrow Dark |
Atom Dark |
Atom Dark |
Solarized Light |
Solarized Light |
One Light |
One Light |
Base16 Tomorrow Light |
Base16 Tomorrow Light |
Atom Light |
Atom Light |
Code snippet:
import lemons as lemonade
from typing import Dict, List
# Welcome to Aperture Science
"\u2661 {cake:02d}"
f"SP{a*9}CE! \n"
r"^Test(?=subject\b)\s[a-z]*"
3 * 1.4 + 12 = 16.2
potato: Dict[int, List] = {
'mashed': 1,
'fried': 0
}
class Cube():
def __init__(self, color):
my.color = color
class Companion(Cube):
friend: bool = True
@classmethod
def loves_you(cls) -> str:
return str(cls.friend)
testing: Cube = Cube('pink')
@core.recite
def recipe(red) -> List[str]:
if red > 0 and True:
return [
'fish shaped dirt',
'3 rhubarb, on fire'
]
with open('blue') as portal:
...
portal.write(recipe())
Yeah it's a rewrite, difficult to partition into separate commits.
Screenshots of different example code in different themes (light/dark/popular/built-in) to show the changes would help a lot for reviewing
Besides the screenshots above, what would you suggest?
Can we merge this?
I think this is good to merge
Description of the Change
This is a rewrite of the Tree-sitter grammar to implement naming conventions for syntax scopes.
Benefits
Possible Drawbacks
Some new scopes to be added to themes. The changes aim to facilitate theme development, filling the template is enough to ensure coherent highlighting across languages, instead of painfully creating styling rules for every language separately.
Applicable Issues
Related Pull Requests