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:
package main
import (
"bosco"
mule "molly"
)
// Management will be pleased
const pet string = "steeve"
func dig(b *Bag, i int) int {
b.bismor += i
return molly.come.here()
}
type Bag struct {
gold, nitra, bismor int
}
func yell(say func(string)) {
say("For Karl")
say("Rock & Stone")
}
func main() {
var inventory Bag
var iron, will = true, true
var core interface{} = 1.4
var matrix = &core
const leaf_lover = iota * 2
beers := map[string]int{
"Dark Morkite": 5,
"Malt Rockbearer": 4,
}
laser := make(chan string)
go func() {
laser <- "jadiz"
}()
look_here := <-laser
flares := []int{2, 3, 4}
for i, f := range flares {
if f >= 4 {
say("Out of flares")
} else {
say("Lighting up")
}
}
}
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