piersdeseilligny / betterfountain

A screenwriting app integrated into visual studio code
https://marketplace.visualstudio.com/items?itemName=piersdeseilligny.betterfountain
MIT License
360 stars 54 forks source link

Use custom scopes for syntax highlighting #175

Open furrykef opened 2 years ago

furrykef commented 2 years ago

I wasn't crazy about the default syntax colors, so I went to tweak them, and I found it rather strange that, for example, constant.numeric is used for scene transitions. There is no semantic connection between a scene transition in Fountain and a numeric constant in a language like C++, so it doesn't seem appropriate to use them. On the other hand, comment.block is quite appropriate for notes ([[like this]]) and boneyards (/* like this */), since they both act like comments. (I do wonder, though, if they should nonetheless have separate scopes, since they are not semantically equivalent.)

This way, for example, if one day you decide you want to change what color you use for numeric constants in (say) C++, Java, and Ruby, you can do it without also changing the color of your scene transitions in Fountain (without having to define an extra rule just for Fountain). It makes sense that the token 123 should have the same color in those three languages; it doesn't make so much sense to me that the phrase (to Sally) in a screenplay should necessarily be that color as well.

piersdeseilligny commented 2 years ago

Hi @furrykef , thanks for the feedback!

So you're correct that the scopes don't really make a ton of sense, but the reason I used them was simply based on the colours and what I thought looked good with most of the default and popular themes (although I do realise it's subjective haha).

The issue is that there aren't really any scopes that would make sense, given how unique fountain is (even compared to markdown). What scopes would you suggest using/replacing?