Open pnlph opened 4 years ago
The best "documentation" I can find is the color scheme defined by the syntax theme, for example, in one dark
From there, you can see how colors are assigned to the "selectors" in the theme:
&.syntax--function {
color: @hue-1;
&.syntax--any-method {
color: @hue-2;
}
}
We assign the "syntax node" that we've parsed to those "selectors"
We can't really decide the color because it depends on which kind of syntax theme you use. The best we can do is to match the semantics of the selectors.
Blue and yellow items are only colored when declared, not when used further in code.
They are not colored further in the code because they belong to different syntax node.
Actually the current coloring rules is a mess. I've no idea which selectors are available before I discovered the secrets of syntax themes. It can use some love and update.
I think the link moved to the one dark syntax theme package in the core Atom repository.
I will take a look at it.
For example with the one dark theme i see the upper and lowe liner white (mono-1) and the comment itself gray (mono-3)
-------------------------
-- Strings of parentheses
-------------------------
I guess then, in this case the syntax node only detects the comments starting with two hyphens and then a space. Is it defined here? https://github.com/banacorn/language-agda/blob/5b2275b47fbf79a5b4722b719e6e8e3c77aea0b4/grammars/agda.cson#L152
The file you are referring to is the old way of syntax highlighting (using regular expressions).
Now we use tree-sitter-agda
for parsing and Agda files:
https://github.com/tree-sitter/tree-sitter-agda/blob/d710ff14d15ddee3764fd73a0837c6c4c8c913e9/grammar.js#L891-L903
I am intrigued by how the colors of the syntax highlight are chosen and and how they are assigned a meaning. Where could I find this connection in the code/documentation?
From what I see:
Blue and yellow items are only colored when declared, not when used further in code.
Did you follow some kind of standard/convention you can point me to?