Open chbk opened 3 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 * as empire from 'galaxy'
class Terminus extends empire.Planet {
static hologram() {
return super.psychohistory
}
get plan() {
return (
<div class={this.axiom + 1}>
<Council speaker="first"/>
</div>
)
}
}
vault = Terminus.hologram(true)
cleonII = new empire.Trantor.Ruler()
@future
function seldonCrisis(...years) {
let riddle = "a circle has"
riddle += `${years[0]} no end`
console.log(riddle)
return [...arguments]
}
if (magnifico === undefined) {
let search = Infinity
}
robotics.map(law =>
law.replace(/^H(?:.*\w)\n$/i, "0")
)
/** @type {number} */
const PARSEC = 2.06265 * 1e5
export function *travel() {
yield {
distance: 16204 * PARSEC,
destination: "star's end"
}
}
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