Open IgnaceMaes opened 7 months ago
@IgnaceMaes I personally like Idea to differentiate between tags and components (it's design decision),
I like before
case because it's explicitly mark "dynamic" parts.
But, I do agree, GH colouring is not perfect, and that we could do here:
Getting GH team to do anything to change colours is unlikely. The linguist project only classifies the languages, syntax highlighting is an internal team we can't talk to.
I agree components should be a different colour, I don't like it matching HTML, the scope could just be a different one to what it is now as the purple color in vscode blends the component name with it's arguments on github.
The braces could be changed I think to be scoped as something else too, closer to how HBS highlights them.
I'll play with some options next week and present something I think will make everyone happy.
@IgnaceMaes, @evoactivity I think we need to create kinda priority list, to agree on parts we would like to highlight, to be able to make different decisions without breaking backward compatibility.
Priority list: (changes should be tested in following order, and should not downgrade DX)
Some key concerns:
@
, so, no real need to add extra to arg name@
as language keyword symbol where it's used as reference, likely same for this.
if
, else
, each
, yield
, outlet
)foo={{@bar}}
cases should have its own accent (more neutral, to reduce visual noise)Variability:
It's fine to fine-tune syntax for different editors/consumers if it's improve DX, we already have scripts to build syntaxes, all we need is figure out general approach on how to keep it in control and not blowing source codebase.
This concerns is not final, but kinda foundation for "language highlighting design", we should agree on parts we not planning to change, to be able to improve other cases.
I agree with your concerns there @lifeart.
I would also suggest two things
variable.constant
for something that isn't a constant if it colours it nicer, should be ok for us to do.I found a textmate theme that implements githubs colours, so I should be able to figure out scope names that colour github better but also keeps vscode nice as well. I'd prefer to find a happy balance that works everywhere rather than have different grammars for editors vs github, but I won't rule out having different grammars if it's an absolute must.
So textmate (and therefore github) doesn't have anything setup in the theme for entity.other.attribute-name
which is why component invocation and attributes are coloured the same as they are just coloured as entities. Also support.function
doesn't seem to exist in the theme so this.thing
is coloured as one colour because variable.language
and support
have the same value. There will be several cases of this.
I'll keep playing around and see what I can come up with.
Origin: https://discord.com/channels/480462759797063690/518154533143183377/1218860748227481671
Open this PR for discussion!
GitHub syntax highlighting:
My main readability issues:
Adapting the first point:
Now seeing that in action, not sure if it's an improvement in VS Code 🤔 VS Code already does not reuse the same color for the component invocation name and the properties, which seems to be the main quirk on GitHub.