-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why highlight types and constants? #20
Comments
Hi @isker, Glad the theme peaked your interest! I think the discussion of what to highlight is very interesting, and in the end, it probably comes down to personal preference. The selection of what to highlight is primarily influenced from two things: alabaster and writing Clojure code. In alabaster, Tonsky highlights constants and global definitions along with comments. I agree with this since I think that there is a conceptual and practical difference between programmatic behaviour and values "baked" into the code itself, i.e. constants. The latter are solely dependant on the source file as such, and therefore I think it makes sense to highlight them. Of course, this can sometimes lead to large parts of yellow in code, as above, but that is also the point. The hiccup/html of However, I agree with you that the decision to highlight types is less clear cut. The initial reason for this is that I mostly program in Clojure, which is dynamically typed. As such, the presence of a type hints marks a rarity that I think make sense to highlight:
In addition, That would be my "conceptual" argument anyway. On a visceral level however, I do kind of agree with you. The times when I program in something like JS I do sometimes feel like highlighting can be a bit "off", although I'm more bothered by how bolded method calls in changing blotch the page. Does that make sense to you? I don't think I'll change the default as I'm against breaking changes once something hits a non-trivial amount of users, but one could image a way to programatically set which parts you would like to have highlighted with something like |
Thanks for your detailed explanation. The screenshots remind me that I really have to patch my font height 🌞. If I stare long enough at I should have elaborated earlier that it seems strange that strings have a fixed gray background and other primitives/constants get highlighted. I might actually try making the highlight-color the same gray95 that strings get. You're right that it's all down to personal preference. And I agree that changing defaults is not a good idea. It looks much better in clojure, for sure. I'm not sure that something like With respect to highlighting types, I've been meaning to look into tree sitter and emacs, and this provides a motivator: in languages with lots of types in code, a good compromise might be to highlight only types of function parameters or return values, for example. Of course I have no idea if tree-sitter's emacs integration even supports that kind of thing. |
Sorry for getting back so late! I think you both make very good points, it makes sense to afford the user the ability to change what they deem worthy of highlighting. I added user facing variables for each One, arbitrary, limitation right now is that you are limited to setting As a reference, Alabaster provides separate fore- and background highlight themes, which there is clearly som merit to, but I think a fully customisable approach makes more in the context of Emacs. |
Hi. Thanks for this nice theme.
After trying it out for a while, I don't understand why so much is being highlighted in yellow.
Here's an example with a random illustrative file from the deno repository:
false
,true
,null
, number literals,TextEncoder
,Promise
, etc are all highlighted here, due to usages ofstimmung-themes-light-highlight-color
here:stimmung-themes/stimmung-themes-light-theme.el
Lines 116 to 133 in d34e83d
It seems a bit much, and it's not clear why constants and typenames deserve to be highlighted. I could of course override this, but I'd also like to hear what you think.
The text was updated successfully, but these errors were encountered: