-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Hi, I have improved (IMO) the Julia highlighter to detect more patterns than what the current implementation does. I presented all of the changes here: https://fredrikekre.se/posts/highlight-julia/ and the code can be found on this branch: https://github.com/fredrikekre/highlight.js/tree/fe/julia-unleashed.
I would like to upstream this work to this repository but I am unsure if it would be accepted wholesale and wanted to discuss it here first. Some of the changes are uncontroversial I believe, some changes are pure bugfixes and some changes might be too "bold" to upstream. I can obviously separate things into separate pull request too.
The first thing I wanted input on is what I called contextual highlighting of types. The section in the post discusses some pros and cons of this, but I quite like it and this is the behavior in many text editors I have used (Sublime Text, VSCode). Would this be something that could be accepted upstream?
The second thing thing is function calls which with my changes are highlighted no matter where they are defined (e.g. in the base language or external package). I think this is nice (obviously) and I think it makes sense in Julia, since there usually is not so important to differentiate builtin functions from functions defined in packages or user code. This is also the reason that quite a lot of functionality in Julia is implemented in external packages, since user-code is as optimized as builtin code. Due to this I don't think keeping a list of builtin function is very useful, the list would be pretty short and not detect much of the code you write anyway. As with contextual highlighting of types, this is what both Sublime Text and VSCode does for Julia code.
I am of course happy to hear your thoughts about the other changes too, but, as I said, I believe they are mostly uncontroversial.
Thanks.